/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/powershell/Modules/Microsoft.PowerShell.Utility/Invoke-Expression.Tests.ps1
25 строк
839 B
xtqqczze
Use correct casing for cmdlet name and cmdlet parameter name in *.ps1 files (#12584)
07 май 2020, 15:00
Не верифицирован
07 май 2020, 15:00
f438220
Код
Авторство
О чём код?
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Describe "Invoke-Expression" -Tags "CI" { Context "Should execute the invoked command validly" { It "Should return the echoed text" { (Invoke-Expression -Command "echo pestertest1") | Should -BeExactly "pestertest1" } It "Should return the echoed text from a script" { $testfile = Join-Path -Path (Join-Path $PSScriptRoot -ChildPath assets) -ChildPath echoscript.ps1 $testcommand = "echo pestertestscript" $testcommand | Add-Content -Path "$testfile" (Invoke-Expression "& '$testfile'") | Should -BeExactly "pestertestscript" Remove-Item "$testfile" } } } Describe "Invoke-Expression DRT Unit Tests" -Tags "CI" { It "Invoke-Expression should work"{ $result=Invoke-Expression -Command 2+2 $result | Should -Be 4 } }