aspnet / dnvm

OBSOLETE - see readme
Other
174 stars 61 forks source link

dnvm.ps1 doesn't work if strict mode is set to 1 #494

Closed wangzq closed 6 years ago

wangzq commented 8 years ago

If I have set strict mode to 1 in my PowerShell profile:

    Set-StrictMode -Version 1

Trying to run dnvm.ps1 will fail with a few errors like following:

   The variable '$DnvmColors' cannot be retrieved because it has not been set.

It is a good idea to test for global variable existence before accessing it:

    if (Test-Path variable:global:DnvmColors) {
        $ColorScheme = $DnvmColors
yooakim commented 8 years ago

I have the same issue, in my $PROFILE I have:

Set-StrictMode -Version latest

and DNVM scripts don't work if I use this. If I comment this out it works fine.