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 / AadSyncStatusConsole-thumbnail.png
Created October 26, 2021 14:56 — forked from dindoliboon/AadSyncStatusConsole-thumbnail.png
Poll Azure AD Connect for the current sync status and initiate a delta sync cycle.
AadSyncStatusConsole-thumbnail.png
@FracVX
FracVX / ConvertTo-DistinguishedName.ps1
Created February 11, 2021 05:27 — forked from wolffberg/ConvertTo-DistinguishedName.ps1
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 / Split-File.ps1
Created February 21, 2020 22:35 — forked from awayken/Split-File.ps1
Split files using Powershell, modified from: http://stackoverflow.com/a/11010158/215200
# Modified from: http://stackoverflow.com/a/11010158/215200
$fromFolder = "D:\FOLDER\"
$rootName = "FILENAME"
$ext = "EXT"
$from = "{0}{1}.{2}" -f ($fromFolder, $rootName, $ext)
$fromFile = [io.file]::OpenRead($from)
$upperBound = 100MB
@FracVX
FracVX / cloudflare-ddns-update.sh
Created September 17, 2019 23:21 — forked from Tras2/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record
Function New-Employee {
[cmdletbinding()]
param(
[Parameter(Mandatory)]
$EmployeeID,
[Parameter(Mandatory)]
$FirstName,
[Parameter(Mandatory)]
@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
@FracVX
FracVX / Delete-AllCmdKeyCredentials.ps1
Created September 4, 2018 20:28 — forked from janikvonrotz/Delete-AllCmdKeyCredentials.ps1
PowerShell: Delete all cmdkey credentials #PowerShell #Windows
cmdkey /list | ForEach-Object{if($_ -like "*Ziel:*"){cmdkey /del:($_ -replace " ","" -replace "Ziel:","")}}
@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
@FracVX
FracVX / WindowsCredentialVault.psm1
Created February 13, 2018 18:36 — forked from guitarrapc/WindowsCredentialVault.psm1
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
{