Skip to content

Instantly share code, notes, and snippets.

@JKerens
JKerens / Retry.ps1
Created July 28, 2022 17:57
PowerShell Retry Wrapper
function WithRetry {
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[ValidateNotNull()]
[ScriptBlock] $Command,
[Parameter(Mandatory = $false)]
[int]$RetryCount = 3
)
Write-Host "Retry Injection Scope"