Coder Social home page Coder Social logo

sthmodulescope's People

Contributors

sethvs avatar

sthmodulescope's Issues

Get-sthScopeDepth return '2' instead '1'

repro :

[STA] C:\temp> ipmo sthModuleScope
[STA] C:\temp> Get-sthScopeDepth
0
[STA] C:\temp> Enter-sthModuleScope -Module sthModuleScope
[sthModuleScope] PS C:\temp>> Get-sthScopeDepth
2
[sthModuleScope] PS C:\temp>> Enter-sthModuleScope -Module sthModuleScope
[sthModuleScope] PS C:\temp>>> Get-sthScopeDepth
3
[sthModuleScope] PS C:\temp>>> exit
[sthModuleScope] PS C:\temp>> Get-sthScopeDepth
2
[sthModuleScope] PS C:\temp>> exit
Remove-Variable : Cannot find a variable with the name 'ModuleName'.
At C:\Program Files\WindowsPowerShell\Modules\sthModuleScope\1.0\sthModuleScope.ps1:20 char:9
+         Remove-Variable -Name ModuleName -Scope Script
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (ModuleName:String) [Remove-Variable], ItemNotFoundException
    + FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.RemoveVariableCommand

[STA] C:\temp> Get-sthScopeDepth
0

Nesting call of Enter-sthModuleScope should not be possible on the same module

repro :

[STA] C:\temp> Enter-sthModuleScope -Module sthModuleScope
[sthModuleScope] PS C:\temp>> Enter-sthModuleScope -Module sthModuleScope
[sthModuleScope] PS C:\temp>>> Enter-sthModuleScope -Module sthModuleScope
[sthModuleScope] PS C:\temp>>>> exit
[sthModuleScope] PS C:\temp>>> exit
Remove-Variable : Cannot find a variable with the name 'ModuleName'.
At C:\Program Files\WindowsPowerShell\Modules\sthModuleScope\1.0\sthModuleScope.ps1:20 char:9
+         Remove-Variable -Name ModuleName -Scope Script
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (ModuleName:String) [Remove-Variable], ItemNotFoundException
    + FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.RemoveVariableCommand

[sthModuleScope] PS C:\temp>> exit
Remove-Variable : Cannot find a variable with the name 'ModuleName'.
At C:\Program Files\WindowsPowerShell\Modules\sthModuleScope\1.0\sthModuleScope.ps1:20 char:9
+         Remove-Variable -Name ModuleName -Scope Script
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (ModuleName:String) [Remove-Variable], ItemNotFoundException
    + FullyQualifiedErrorId : VariableNotFound,Microsoft.PowerShell.Commands.RemoveVariableCommand

Get-sthModuleScopeFunction -PublicOnly return private members

repro :

[STA] C:\temp> ipmo sthModuleScope
[STA] C:\temp> (get-module sthModuleScope).ExportedCommands

Key                        Value
---                        -----
Enter-sthModuleScope       Enter-sthModuleScope
Get-sthModuleScopeFunction Get-sthModuleScopeFunction
Get-sthModuleScopeVariable Get-sthModuleScopeVariable
Get-sthScopeDepth          Get-sthScopeDepth


[STA] C:\temp> Enter-sthModuleScope -Module sthModuleScope
[sthModuleScope] PS C:\temp>>  Get-sthModuleScopeFunction -PublicOnly

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Enter-sthModuleScope                               1.0        sthModuleScope
Function        Get-sthModuleScopeFunction                         1.0        sthModuleScope
Function        Get-sthModuleScopeVariable                         1.0        sthModuleScope
Function        Get-sthScopeDepth                                  1.0        sthModuleScope
Function        inSetSessionState                                  1.0        sthModuleScope
Function        prompt                                             1.0        sthModuleScope


[sthModuleScope] PS C:\temp>> Get-sthModuleScopeFunction

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Enter-sthModuleScope                               1.0        sthModuleScope
Function        Get-sthModuleScopeFunction                         1.0        sthModuleScope
Function        Get-sthModuleScopeVariable                         1.0        sthModuleScope
Function        Get-sthScopeDepth                                  1.0        sthModuleScope
Function        inSetSessionState                                  1.0        sthModuleScope
Function        prompt                                             1.0        sthModuleScope

Version :

[STA] C:\temp> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.14409.1012
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14409.1012}
BuildVersion                   10.0.14409.1012
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

#Windows Seven Sp1 -Fr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.