Hello,
I'm trying to call a command in PowerShell using an environment variable. Using cmd, I would call the exe using the following command %userprofile%somefolderrandom.exe. When I use this command, $env:homepathsomefolderrandom.exe, I get an unexpected token error. Browsing the web, I found this command ~somefolderrandom.exe and this works, but I don't understand why it works and $env:homepathsomefolderrandom.exe doesn't to call the script?