system.management.automation.dll PowerShell.
. , ,
ps.AddCommand("Get-Process");
- :
ps.AddCommand(<script-path/name-of-script-in-path>).AddParameter("Log", logInstance);
It tells you to call your script with a parameter Logwhose value is the instance logInstanceto be passed to the script. The script should have a parameter Logand use it as $Login its code:
param($Log)
$Log.Write("Begin ...")
...
$Log.Write("End ...")
source
share