Skip to content

Instantly share code, notes, and snippets.

View mkesper's full-sized avatar

Michael Kesper mkesper

View GitHub Profile
@mkesper
mkesper / bash
Created February 6, 2020 14:50
AWX installation
# ansible-playbook -i inventory install.yml -e "postgres_data_dir=/var/lib/pgdocker"
PLAY [Build and deploy AWX] **************************************************************************************
TASK [Gathering Facts] *******************************************************************************************
ok: [localhost]
TASK [check_vars : include_tasks] ********************************************************************************
skipping: [localhost]
@mkesper
mkesper / Takeown.ps1
Last active August 29, 2015 14:25
Why i18n of commands is a very bad idea
# Thank you, Microsoft!
switch((Get-UICulture).Name){
# You need to check for every Culture the script could encounter
"de-DE" {$Yes = "J"}
default {$Yes = "Y"}
}
$TakeOwnParameters = @("/f", $Share, "/R", "/D", $Yes)
Invoke-Expression "takeown.exe @TakeOwnParameters" | Write-Output
@mkesper
mkesper / Caller.ps1
Last active August 29, 2015 14:24
Powershell Invoke-Expression Parameter Trouble
Set-StrictMode -Version "2.0"
function ProcessContent{
$FileName = Join-Path "C:\PATH\IN" ("{0}.JSON" -f $PlannedChanges.Anforderung.Changenummer)
$PlannedChanges|ConvertTo-Json -Compress|Out-File -Encoding utf8 $FileName
Invoke-Expression "C:\PATH\Skript\MoveHome.ps1 -changenummer $PlannedChanges.Anforderung.Changenummer"
}
Get-ChildItem "C:\PATH\IN" -Filter *.TXT | Where-Object{$_.FullName -ne $null} |`
ForEach-Object{