ironmansoftware / poshtools-docs

PowerShell Tools Documentation
MIT License
20 stars 10 forks source link

$PSScriptRoot and $PSCommandPath in scripts converted to EXE #8

Open banyula opened 4 years ago

banyula commented 4 years ago

Variabled $PSScriptRoot and $PSCommandPath are empty in all scripts that were converted to EXE.

Please provide alternatives to get these values.

$invocation.MyCommand.Path does not work either.

adamdriscoll commented 4 years ago

Can you please provide an example? This should be happening but it may be a bug.

banyula commented 4 years ago

$PSScriptRoot is working now that I updated the Tools.

See below screenshot. Same script, executed as PS1 and then executed as EXE. $PSCommandPath is null, as well as $MyInvocation.MyCommand.Path

Issues-8

PierroD commented 4 years ago

Same porblem when I build my solution using $PSScriptRoot this isn't working but when I debug it it's fully working image I guess something might be wrong when it's build into C# image