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
{ | |
"Condition statement": { | |
"prefix": "cond", | |
"body": [ | |
"${_} { ${0}; break }" | |
], | |
"description": "Switch condition statement" | |
}, | |
"Condition single quoted string statement": { |
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-DN { | |
[cmdletbinding()] | |
param( | |
[Parameter(Mandatory,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)] | |
[ValidateNotNullOrEmpty()] | |
[string[]]$DistinguishedName | |
) | |
process { | |
foreach ($DN in $DistinguishedName) { | |
Write-Verbose $DN |
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 ConvertTo-DistinguishedName{ | |
[CmdletBinding()] | |
Param( | |
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)] | |
$CanonicalName | |
) | |
Begin{ | |
# StringBuilders used to build DestinguishedName and LDAP query | |
$dn = [System.Text.StringBuilder]::new() | |
$ldapQuery = [System.Text.StringBuilder]::new() |
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
<# | |
.SYNOPSIS | |
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager | |
.DESCRIPTION | |
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The | |
Get-StoredCredential function can only access Generic Credentials. | |
Alias: GSC |
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 InitializeWindowsCredential | |
{ | |
Write-Verbose ("Loading PasswordVault Class.") | |
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime] | |
} | |
InitializeWindowsCredential | |
function ConvertTo-PasswordCredential | |
{ |