Workspace ONE Scripts and Here Strings

So it turns if you like using Here strings in PowerShell you will run in to dramas with using the Scripts section, the assumption is its breaking however VMware parses the string to convert.

So if you are writing some JSON code to parse to an API you can just do it like this instead:

$Body=@{
        DeviceFriendlyName = "Bob"
        SomeOtherAttribute = "Two"
        EvenMoarAttributes = "Three"
        }

    $Payload= $Body | ConvertTo-Json

I’m sure there are other workaround for differing scenarios, I’ll update this as I come across them.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.