Hi,
Is there any way to stop variable expansion happening with parameter values that are passed to a function?
For example, if I run the below function and neglect to use single quotes for the parameter value, the double dollar automatic variable is expanded:
function Test-Parameter { param( [string]$String ) $PSBoundParameters } Test-Parameter -String stringwithdollars$$
I realise this is just ‘how PowerShell works’ but wondered if there is anyway to foolproof this.