Skip to content

Commit

Permalink
new pwsh module demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ninmonkey committed Jan 5, 2024
1 parent ccf5edc commit 7fc33a1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Pwsh/Modules/BasicModuleScope.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
$script:Cache = @{}
$script:DefaultUser = $Null
function Get-NinModules {
# caches module listing
param()
$state = $script:cache
if( -not $state.ContainsKey('AllModules') ) {
'not cached, please wait....' | write-host -fore 'yellow'
$state.AllModules = Get-Module -ListAvailable | Sort-Object
}
return $state.AllModules
}

function Set-NinUser {
param( [string]$Username)
$script:DefaultUser = $UserName
}

Export-moduleMember -Function @(
'*-Nin*'
)

0 comments on commit 7fc33a1

Please sign in to comment.