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
$request = @{ | |
Uri = 'https://api.pushover.net/1/messages.json' | |
Method = 'POST' | |
ContentType = 'application/x-www-form-urlencoded' | |
Body = @{ | |
token = 'abc123' | |
user = 'user123' | |
message = 'hello world' | |
} | |
} |
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 ConvertFrom-StringData { | |
<# | |
.FORWARDHELPTARGETNAME Microsoft.PowerShell.Utility\ConvertFrom-StringData | |
#> | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory, Position = 1, ValueFromPipeline)] | |
[string]$StringData, |
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
using namespace System.Management.Automation | |
using namespace System.Security.Cryptography.X509Certificates | |
function ConvertTo-X509Certificate { | |
<# | |
.SYNOPSIS | |
Convert a Base64 encoded certificate (with header and footer) to an X509Certificate object. | |
.DESCRIPTION | |
ConvertTo-X509Certificate reads a Base64 encoded certificate string or file and converts it to an X509Certificate object. | |
.EXAMPLE |
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-TaskStartDate { | |
<# | |
.SYNOPSIS | |
Get a start date from a string expression. | |
.DESCRIPTION | |
Finds the start date from a string expression. | |
.EXAMPLE | |
Get-TaskStartDate -Day '1st Monday' |
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-RpcPort { | |
<# | |
.SYNOPSIS | |
Enumerates and tests connectivity to the RPC ports on the target server. | |
.DESCRIPTION | |
Enumerates and tests connectivity to the RPC ports on the target server. | |
Rebuilt from https://gallery.technet.microsoft.com/Test-RPC-Testing-RPC-4396fcda | |
#> |
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 Split-DistinguishedName { | |
<# | |
.SYNOPSIS | |
Split a distinguishedName into named pieces. | |
.DESCRIPTION | |
Split a distinguishedName into Name, ParentDN, ParentName, and DomainComponent. | |
.EXAMPLE | |
Split-DistinguishedName 'OU=somewhere,DC=domain,DC=com' |
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-ADAttributeAlias { | |
<# | |
.SYNOPSIS | |
Gets the names of the aliased attributes from the ActiveDirectory module. | |
.DESCRIPTION | |
Users reflection to discover the names of the attribute aliases available to filters. | |
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
using module ActiveDirectory | |
using namespace System.Reflection | |
function Convert-ADFilter { | |
<# | |
.SYNOPSIS | |
Converts PowerShell-style filters used by the AD module into LDAP filters. | |
.DESCRIPTION | |
Convert-ADFilter uses the QueryParser from the AD module to convert PowerShell-style filters into LDAP |
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 Export-EventLog { | |
<# | |
.SYNOPSIS | |
Export an event log to a saved event log file. | |
.DESCRIPTION | |
Export an event log, and it's messages, to a named event log file. | |
.EXAMPLE | |
Get-WinEvent -ListLog Application | Export-EventLog |
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 Invoke-NativeCommand { | |
<# | |
.SYNOPSIS | |
Invoke a native command (.exe) as a new process. | |
.DESCRIPTION | |
Invoke-NativeCommand executes an arbitrary executable as a new process. Both the standard | |
and error output streams are redirected. | |
Error out is written as a single non-terminating error. ErrorAction can be used to raise |