PowerShellMafia / PowerSploit

PowerSploit - A PowerShell Post-Exploitation Framework
Other
11.68k stars 4.59k forks source link

Add-Persistence : Cannot process argument transformation on parameter 'ScriptBlock'. #324

Closed pawp81 closed 5 years ago

pawp81 commented 5 years ago

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.

mattifestation commented 5 years ago

@toomuchmunsch Can you please send your spam in the form of a pull request?