-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathugit.ps.psm1
More file actions
19 lines (15 loc) · 709 Bytes
/
ugit.ps.psm1
File metadata and controls
19 lines (15 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$CommandsPath = Join-Path $PSScriptRoot Commands
[include('*-*.ps1')]$CommandsPath
$MyModule = $MyInvocation.MyCommand.ScriptBlock.Module
$MyModule.pstypenames.insert(0,$MyModule.Name)
$ExecutionContext.SessionState.PSVariable.Set($MyModule.Name, $myModule)
$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