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

Schannel Issue

Indexing Server

oclist /xml or /?