Download PowerShell-master/test/powershell/Provider/AutomountSubstDrive.ps1 from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 806 Bytes
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/Provider/AutomountSubstDrive.ps1
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/powershell/Provider/AutomountSubstDrive.ps1
-
curl -L -o AutomountSubstDrive.ps1 https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/Provider/AutomountSubstDrive.ps1
806 Bytes
| # Copyright (c) Microsoft Corporation. | |
| # Licensed under the MIT License. | |
| # Precondition: start from fresh PS session, do not have the media mounted | |
| param([switch]$useModule, [string]$FullPath) | |
| $global:CoreScriptPath = Join-Path $PSScriptRoot 'AutomountSubstDriveCore.ps1' | |
| if ($useModule) | |
| { | |
| $m = New-Module { | |
| function Test-DrivePresenceFromModule | |
| { | |
| param ([String]$Path) | |
| & $global:CoreScriptPath -Path $Path | |
| } | |
| Export-ModuleMember -Function Test-DrivePresenceFromModule | |
| } | |
| } | |
| try | |
| { | |
| if ($useModule) | |
| { | |
| Import-Module $m -Force | |
| Test-DrivePresenceFromModule -Path $FullPath | |
| } | |
| else | |
| { | |
| & $global:CoreScriptPath -Path $FullPath | |
| } | |
| } | |
| finally | |
| { | |
| if ($useModule) | |
| { | |
| Remove-Module $m | |
| } | |
| } | |