Home Dashboard Directory Help
Search

PSScriptRoot in ps1 script in PSv3 is empty in ISE by J Stangroome


Status: 

Active


4
0
Sign in
to vote
Type: Bug
ID: 769359
Opened: 10/31/2012 1:56:02 PM
Access Restriction: Public
0
Workaround(s)
view
2
User(s) can reproduce this bug

Description

In the PSv3 documentation, $PSScriptRoot is now an automatic variable that is populated for both modules and ps1 scripts. It works from PowerShell.exe but not from the ISE
Details
Sign in to post a comment.
Posted by Michael Naumov on 10/31/2012 at 4:32 PM
Interesting bug.

I could reproduce it

However even in that situation

$myVar = $PSScriptRoot

works as expected and the correct value is set to $myVar

Sign in to post a workaround.