From 5330010b6c981afb99b9f8b4f6300576bc82ed56 Mon Sep 17 00:00:00 2001 From: StartAutomating Date: Sat, 20 Apr 2024 21:23:44 +0000 Subject: [PATCH] feat: Mounting 4bitcss ( Fixes #48 ) --- 4bitcss.psm1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/4bitcss.psm1 b/4bitcss.psm1 index e601494b72..21894bd80c 100644 --- a/4bitcss.psm1 +++ b/4bitcss.psm1 @@ -13,4 +13,15 @@ $myModule = $MyInvocation.MyCommand.ScriptBlock.Module $ExecutionContext.SessionState.PSVariable.Set($myModule.Name, $myModule) $myModule.pstypenames.insert(0, $myModule.Name) +$newDriveSplat = @{PSProvider='FileSystem';ErrorAction='Ignore';Scope='Global'} +New-PSDrive -Name $MyModule.Name -Root ($MyModule | Split-Path) @newDriveSplat + +if ($home) { + $myMyModule = "My$($myModule.Name)" + $myMyModuleRoot = Join-Path $home $myMyModule + if (Test-Path $myMyModuleRoot) { + New-PSDrive -Name $myMyModule -Root $myMyModuleRoot @newDriveSplat + } +} + Export-ModuleMember -Function *-* -Alias * -Variable $myModule.Name