This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Grant-FSPermission { | |
<# | |
.SYNOPSIS | |
Helper tool to simplify file system permission assignments. | |
.DESCRIPTION | |
Helper tool to simplify file system permission assignments. | |
Allows bulk-updating / assigning permissions. | |
.PARAMETER Identity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Write-EventLogEntry | |
{ | |
<# | |
.SYNOPSIS | |
Write an eventlog entry | |
.DESCRIPTION | |
Write an eventlog entry | |
.PARAMETER LogName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function New-Password | |
{ | |
<# | |
.SYNOPSIS | |
Generate a new, complex password. | |
.DESCRIPTION | |
Generate a new, complex password. | |
.PARAMETER Length |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-PrintNightmareVulnerability { | |
<# | |
.SYNOPSIS | |
Tests whether the target system is vulnerable to the PrintNightmare vulnerability. | |
.DESCRIPTION | |
Tests whether the target system is vulnerable to the PrintNightmare vulnerability. | |
Uses PowerShell remoting. | |
This checks whether vulnerable GPO/registry settings are applied. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Show-SaveFileDialog { | |
[CmdletBinding()] | |
param ( | |
[string] | |
$InitialDirectory = '.', | |
[string] | |
$Filter = '*.*', | |
$Filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Show-OpenFileDialog { | |
<# | |
.SYNOPSIS | |
Show an Open File dialog using WinForms. | |
.DESCRIPTION | |
Show an Open File dialog using WinForms. | |
.PARAMETER InitialDirectory | |
The initial directory from which the user gets to pick a file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-UserInput { | |
<# | |
.SYNOPSIS | |
Asks for user input, then validates response. | |
.DESCRIPTION | |
Asks for user input, then validates response. | |
.PARAMETER Prompt | |
The message to show to the user as input prompt. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-TlsProtocol { | |
<# | |
.SYNOPSIS | |
A quick helper function to test supported TLS protocols | |
.DESCRIPTION | |
A quick helper function to test supported TLS protocols | |
.PARAMETER ComputerName | |
The hosts to check. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Sample snippet to interact with the NTDS certificate store using windows APIs | |
#> | |
$source = @' | |
using System; | |
using System.Runtime.InteropServices; | |
public static class StoreHelper | |
{ | |
[DllImport("CRYPT32.DLL", EntryPoint="CertOpenStore", CharSet=CharSet.Auto, SetLastError=true)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Start-Script { | |
<# | |
.SYNOPSIS | |
Launches a target script in a new process, passing through all parameters. | |
.DESCRIPTION | |
Launches a target script in a new process, passing through all parameters. | |
Uses dynamic parameters to offer the same signature as the script itself. | |
Uses the same powershell hosting application that executes Start-Script to start the new process. | |