Tag: scripting
All the articles with the tag "scripting".
-
Execution of external commands (native applications) in PowerShell done right - Part 3
Fixing Invoke-NativeApplication to handle Windows exit codes beyond 0-255 using an IgnoreExitCode switch.
-
Execution of external commands (native applications) in PowerShell done right - Part 2
Improved Invoke-NativeApplication with an IsError property on each output line and a prompt function edge-case fix.
-
Execution of external commands in PowerShell done right
A PowerShell exec helper that correctly captures stdout and stderr from native commands and checks exit codes.
-
PowerShell and IDisposable
Implementing a PSUsing helper function in PowerShell that mimics C# using blocks for IDisposable objects.
-
PowerShell auto variable $LastResult
Adding a $LastResult automatic variable to PowerShell by wrapping Out-Default to store the last pipeline output.
-
PowerShell Start-Job WTF
Troubleshoots Start-Job scope issues with PSScriptRoot and shows how to invoke a script path asynchronously using ScriptBlock.Create.
-
PowerShell scripts and "Pattern Main"
Pattern for structuring PowerShell scripts with a Main function so core logic appears at the top before helper functions.
-
Set-StrictMode and legacy code issues
How Set-StrictMode interacts with legacy PowerShell scripts and safe workarounds for missing variables and properties.
-
git checkout on bare repo
How to extract files and folders from a bare git repository using git archive, avoiding encoding and binary issues.
-
Interesting git helpers snippets
PowerShell git helper snippets: get current branch, resolve refs, test fast-forward, find commit's originating branch.