Windows-powershell / PowerShell-master /test /powershell /Language /Parser /AutomaticVariables.Tests.ps1
Download PowerShell-master/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1 from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1
-
curl -L -o AutomaticVariables.Tests.ps1 https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/powershell/Language/Parser/AutomaticVariables.Tests.ps1
1.07 kB
| # Copyright (c) Microsoft Corporation. | |
| # Licensed under the MIT License. | |
| Describe 'Automatic variable $input' -Tags "CI" { | |
| # $input type in advanced functions | |
| It '$input Type should be arraylist and object array' { | |
| function from_begin { [cmdletbinding()]param() begin { Write-Output -NoEnumerate $input } } | |
| function from_process { [cmdletbinding()]param() process { Write-Output -NoEnumerate $input } } | |
| function from_end { [cmdletbinding()]param() end { Write-Output -NoEnumerate $input } } | |
| (from_begin) -is [System.Collections.ArrayList] | Should -BeTrue | |
| (from_process) -is [System.Collections.ArrayList] | Should -BeTrue | |
| (from_end) -is [System.Object[]] | Should -BeTrue | |
| } | |
| It 'Empty $input really is empty' { | |
| & { @($input).Count } | Should -Be 0 | |
| & { [cmdletbinding()]param() begin { @($input).Count } } | Should -Be 0 | |
| & { [cmdletbinding()]param() process { @($input).Count } } | Should -Be 0 | |
| & { [cmdletbinding()]param() end { @($input).Count } } | Should -Be 0 | |
| } | |
| } | |