sethvs / sthmodulescope Goto Github PK
View Code? Open in Web Editor NEWTools for working with elements in module scope.
Tools for working with elements in module scope.
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
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.