Tag

Convert String to Scriptblock

1 article

  • ,

    Powershell: Convert String to Scriptblock

    If you use PowerShell remoting in some scripts, you will ses you cannot use a string to send it with the Invoke-Command cmdlet. So you can simple convert a String to a Scriptblock  $scriptBlock = [Scriptblock]::Create($string)…