Download PowerShell-master/test/powershell/Provider/ProviderIntrinsics.Tests.ps1 from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 750 Bytes
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/Provider/ProviderIntrinsics.Tests.ps1
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/powershell/Provider/ProviderIntrinsics.Tests.ps1
-
curl -L -o ProviderIntrinsics.Tests.ps1 https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/Provider/ProviderIntrinsics.Tests.ps1
750 Bytes
| # Copyright (c) Microsoft Corporation. | |
| # Licensed under the MIT License. | |
| Describe "ProviderIntrinsics Tests" -tags "CI" { | |
| BeforeAll { | |
| Setup -d TestDir | |
| } | |
| It 'If a childitem exists, HasChild method returns $true' { | |
| $ExecutionContext.InvokeProvider.ChildItem.HasChild("$TESTDRIVE") | Should -BeTrue | |
| } | |
| It 'If a childitem does not exist, HasChild method returns $false' { | |
| $ExecutionContext.InvokeProvider.ChildItem.HasChild("$TESTDRIVE/TestDir") | Should -BeFalse | |
| } | |
| It 'If the path does not exist, HasChild throws an exception' { | |
| { $ExecutionContext.InvokeProvider.ChildItem.HasChild("TESTDRIVE/ThisDirectoryDoesNotExist") } | | |
| Should -Throw -ErrorId 'ItemNotFoundException' | |
| } | |
| } | |