VMware Cloud Community
HywelB
Enthusiast
Enthusiast

Escaping an Ampersand

Hi,

I have a script using get-cluster, one of the cluster names is "Dev & Test"

e.g. $clusters = Get-Clusters

I am then running the "Get-Stat -Entity $clusters" command in a loop but it doesn't bring back the data on the "Dev & Test" with the ampersand. Please could someone explain how I can escape the character in the variable.

Thanks

Reply
0 Kudos
2 Replies
prd
Enthusiast
Enthusiast

use the ` character

Reply
0 Kudos
HywelB
Enthusiast
Enthusiast

Hi,

How would that work in front of a array like $clusters as most values don't need escaping.

Thanks for the reply

Reply
0 Kudos