Expand string Variable stored via Single Quote in Powershell

前端 未结 2 468
挽巷
挽巷 2020-12-11 22:08

I have a scenario where I need to construct a powershell path as $RemotePath = \'$($env:USERPROFILE)\\Desktop\\Shell.lnk\'. This variable gets passed to a remot

2条回答
  •  萌比男神i
    2020-12-11 22:56

    By using a double quotes. PowerShell won't expand variables inside single-quoted strings.

提交回复
热议问题