Download PowerShell-master/test/powershell/engine/Basic/Credential.Tests.ps1 from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 602 Bytes
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/engine/Basic/Credential.Tests.ps1
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/powershell/engine/Basic/Credential.Tests.ps1
-
curl -L -o Credential.Tests.ps1 https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/engine/Basic/Credential.Tests.ps1
602 Bytes
| # Copyright (c) Microsoft Corporation. | |
| # Licensed under the MIT License. | |
| Describe "Credential tests" -Tags "CI" { | |
| It "Explicit cast for an empty credential returns null" { | |
| # We should explicitly check that the expression returns $null | |
| [PSCredential]::Empty.GetNetworkCredential() | Should -BeNullOrEmpty | |
| } | |
| It "Explicit credential cast with string produces an exception message without value" { | |
| $ex = { [pscredential]"1234" } | Should -Throw -ErrorId "ConvertToFinalInvalidCastException" -PassThru | |
| $ex.Exception.Message | Should -Not -Match "1234" | |
| } | |
| } | |