Skip to content

Instantly share code, notes, and snippets.

@shaneis
Created April 24, 2018 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaneis/5a13a17471ac28a81b16bbc63983d79e to your computer and use it in GitHub Desktop.
Save shaneis/5a13a17471ac28a81b16bbc63983d79e to your computer and use it in GitHub Desktop.
using .Invoke() method on a scriptblock
for ($i = 0; $i -lt 10; $i++) {
[PSCustomObject]@{
Date = Get-Date
ScriptBlock = 'Actual Scriptblock'
DateDescription = $Script.Invoke()
}
Start-Sleep -Seconds 6
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment