In what type should ScriptBlock be provided? How to prepare the script for adding persistence to it? When I refer to powershell script by calling -ScriptBlock parameter I get following error:
Add-Persistence -ScriptBlock .\get-process.ps1 -UserPersistenceOption $elevatedOptions -verbose
Add-Persistence : Cannot process argument transformation on parameter 'ScriptBlock'. Cannot convert the ".\getprocess.ps1" value of type "System.String" to type "System.Management.Automation.ScriptBlock"
getprocess.ps1 has single instruction: get-process.
In what type should ScriptBlock be provided? How to prepare the script for adding persistence to it? When I refer to powershell script by calling -ScriptBlock parameter I get following error: Add-Persistence -ScriptBlock .\get-process.ps1 -UserPersistenceOption $elevatedOptions -verbose Add-Persistence : Cannot process argument transformation on parameter 'ScriptBlock'. Cannot convert the ".\getprocess.ps1" value of type "System.String" to type "System.Management.Automation.ScriptBlock"
getprocess.ps1 has single instruction: get-process.