Windows-powershell / PowerShell-master /test /powershell /engine /Basic /RegisterAssemblyResolverEarly.ps1
Download PowerShell-master/test/powershell/engine/Basic/RegisterAssemblyResolverEarly.ps1 from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 819 Bytes
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/engine/Basic/RegisterAssemblyResolverEarly.ps1
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/powershell/engine/Basic/RegisterAssemblyResolverEarly.ps1
-
curl -L -o RegisterAssemblyResolverEarly.ps1 https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/engine/Basic/RegisterAssemblyResolverEarly.ps1
819 Bytes
| # Copyright (c) Microsoft Corporation. | |
| # Licensed under the MIT License. | |
| Describe "Assembly resolvers should be registered early at startup" -Tags "CI" { | |
| ## The PKI module requires loading an assembly from GAC, and thus depends on the PowerShell assembly resolver to work. | |
| It "Can load the PKI module with 'pwsh -ExecutionPolicy bypass -NoProfile -c `"Import-Module PKI`"'" -Skip:(!$IsWindows) { | |
| ## Use 'Bypass' execution policy so that it doesn't trigger 'AuthorizationManager' which would trigger 'ClrFacade' initialization. | |
| ## We want to make sure even if 'ClrFacade' is not hit during startup, the resolvers are still registered early enough. | |
| $out = pwsh -ExecutionPolicy bypass -NoProfile -c "Import-Module PKI; Get-Module | % name" | |
| $out | Should -BeExactly "PKI" | |
| } | |
| } | |