Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
banyula opened this issue Dec 24, 2019 · 3 comments
Open

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

banyula opened this issue Dec 24, 2019 · 3 comments

Comments

@banyula
Copy link

banyula commented Dec 24, 2019

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
Copy link
Member

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

@banyula
Copy link
Author

banyula commented Jan 22, 2020

$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
Copy link

PierroD commented Mar 12, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants