Cannot System.string to System.Management.Automation.ScriptBlock


hi

i try execute script

invoke-command -scriptblock "get-date" 


and recive exception:

invoke-command : cannot bind parameter 'scriptblock'. cannot convert "get-date" value of type "system.string" type "system.management.automation.scriptblock".

my question why? of scripts working way.


you're using string, not scriptblock.


invoke-command -scriptblock { get-date }




Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Group Policy Event ID 1058 Error Code 1326 (The user name or password is incorrect)

Suspicious event log Event ID: 4905

DCOM received error "2147746132" from...