'What is the meaning of such construction in powershell
Very newbie question. Found such workflow in MS Exchange script:
[CmdletBinding()]
param ()
begin {
$scriptBlock = {
function foo {
# some code
}
foo
}
}
process {
Invoke-Command -ScriptBlock $scriptBlock
}
as i understand it is for running this script on remote hosts, but how? or there are any other reasons for such invoke-comand as a single call in process part? Or please sugest keywords to find more about this?
Here is full script: aka.ms/ResetScanEngineVersion
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
