This file contains hidden or 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-DhcpClientOption { | |
[CmdletBinding()] | |
param ( ) | |
$adapters = Get-CimInstance Win32_NetworkAdapterConfiguration -Filter 'IPEnabled=TRUE AND DhcpEnabled=TRUE' | |
foreach ($adapter in $adapters) { | |
$params = @{ | |
LiteralPath = Join-Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces' -ChildPath $adapter.SettingID | |
Name = 'DhcpInterfaceOptions' | |
} |
This file contains hidden or 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 Update-ManufacturerList { | |
<# | |
.SYNOPSIS | |
Updates the cached manufacturer list maintained by the IEEE. | |
.DESCRIPTION | |
Update-ManufacturerList attempts to download the assigned list of MAC address prefixes using Get-WebContent. | |
The return is converted into an XML format to act as the cache file for Get-Manufacturer. | |
.PARAMETER Source | |
By default, the manufacturer list is downloaded from http://standards.ieee.org/develop/regauth/oui/oui.txt. An alternate source may be specified if required. |
This file contains hidden or 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.Language | |
function Enable-ScriptAlias { | |
<# | |
.SYNOPSIS | |
Replace all aliased commands in a script with the alias name. | |
.DESCRIPTION | |
Replace all aliased commands in a script with the alias name. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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. | |