Potential bug when search by Tag

Product: PowerShell Universal
Version: 3.1.4

When I attempt to search script by Tag name using the below script I am receiving a ‘[error] Object reference not set to an instance of an object.’ error.

Get-PSUScript -Tag “Test”

Works fine when all scripts in the PSU are associated with a Tag. When one or more script are not assigned with a Tag I am receiving the above error.

One other quick question… What is the best way to get the list of current script’ s Tag during runtime ? I would like to access the Tag list for the current script and control the local variable value based on the Tag associated with the script.

Definitely a bug! Feel free to open an issue on our tracker.

I think you can use $UAJob.Tags to get the current jobs tags.

New bug added to tracker.

1 Like