Skip to content

Instantly share code, notes, and snippets.

View FracVX's full-sized avatar
🎯
Focusing

Erick Moreno FracVX

🎯
Focusing
View GitHub Profile
@FracVX
FracVX / powershell.json
Created July 9, 2019 19:01 — forked from rkeithhill/powershell.json
PowerShell snippets file for Visual Studio Code - place in your ~\AppData\Roaming\Code\User\Snippets directory
{
"Condition statement": {
"prefix": "cond",
"body": [
"${_} { ${0}; break }"
],
"description": "Switch condition statement"
},
"Condition single quoted string statement": {
@FracVX
FracVX / ConvertFrom-DNorCanonical
Created March 25, 2019 16:22 — forked from joegasper/ConvertFrom-DN
Convert between DistinguishedName and CanonicalName
function ConvertFrom-DN {
[cmdletbinding()]
param(
[Parameter(Mandatory,ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
[ValidateNotNullOrEmpty()]
[string[]]$DistinguishedName
)
process {
foreach ($DN in $DistinguishedName) {
Write-Verbose $DN
@wolffberg
wolffberg / ConvertTo-DistinguishedName.ps1
Last active February 11, 2021 05:27
Function to check and convert CanonicalName to DestinguishedName
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()
@FracVX
FracVX / Get-CredentialFromWindowsCredentialManager.ps1
Created February 13, 2018 18:48 — forked from cdhunt/Get-CredentialFromWindowsCredentialManager.ps1
Gets a PowerShell Credential [PSCredential] from the Windows Credential Manager. This only works for Generic Credentials.
<#
.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
@guitarrapc
guitarrapc / WindowsCredentialVault.psm1
Last active January 15, 2021 18:49
PowerShell Windows Credential Vault Module
function InitializeWindowsCredential
{
Write-Verbose ("Loading PasswordVault Class.")
[void][Windows.Security.Credentials.PasswordVault,Windows.Security.Credentials,ContentType=WindowsRuntime]
}
InitializeWindowsCredential
function ConvertTo-PasswordCredential
{