Skip to content

Loading…

Running psake creates global $psake variable #113

Closed
togakangaroo opened this Issue · 2 comments

3 participants

@togakangaroo
  Invoke-Psake anyFile.ps1 anyTask

you'll notice that after this has completed, there is now a $psake variable polluting the global variable space.

@nightroman

It is also enough to import the module in order to get this variable

ipmo C:\TEMP\psake\psake.psm1
$psake

But this is probably by design and documented. See psake.psm1:

export-modulemember -function ... -variable psake

In order to get rid of the variable, remove the module:

Remove-Module psake
@damianh
psake member

You will notice that some people are accessing that variable after their script has run: #119

As @nightroman says, by design and removing the module removes the variable.

@damianh damianh closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.