Skip to content

Instantly share code, notes, and snippets.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active March 16, 2026 01:07
set -e, -u, -o, -x pipefail explanation
###### STEP 1 - Get GIT Credentials
$EncryptedPasswordString = "Your Encrypted Github Password String"
$Args = "Your Github Username", ($EncryptedPasswordString |ConvertTo-SecureString)
$GitCreds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Args
# Required Functions
Function Update-AllPowerShellProfile
{
$ProfileDirectory = "$env:USERPROFILE\Documents\WindowsPowerShell\"
$AllPSPRofiles = dir $ProfileDirectory | ?{$_.name -like "*Profile*"} | sort LastWriteTime -Descending
@Warrenn
Warrenn / transform.ps1
Last active August 23, 2021 14:51
Powershell script to transform a config file using a XML-Document-Transform file
function XmlDocTransform($xml, $xdt, $output)
{
if (!$xml -or !(Test-Path -path $xml -PathType Leaf)) {
throw "File not found. $xml";
}
if (!$xdt -or !(Test-Path -path $xdt -PathType Leaf)) {
throw "File not found. $xdt";
}
$transformDll = ""