Don’t do that: You want to display: The share “\\server\share$“ is not available (where share$ is a hidden share).
You write the following code and you escape the double quotes with a backtick (`), the double quotes are missing: ““
1 |
Write-Host "The share "\\server\share$" is not available" |
Output:
So you do the following and it works:
Do that: A better way is to use just the single quotes instead of double quotes:
Write-Output -InputObject 'The share "\\server\share$" is not available'
Output:
Note: single quotes don’t allow variable expansion (in other words, variables between single quotes are not interpreted).