Created
May 9, 2015 04:38
-
-
Save altrive/1d2ada60a3c74e3fb011 to your computer and use it in GitHub Desktop.
Remotely PowerShell Module Tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-Message | |
{ | |
Write-Verbose "Test Message" -Verbose | |
} | |
Describe "Test-Remotely"{ | |
It "Send local function to remote session"{ | |
#Arrange: Send local function definition to remote session | |
Remotely ([ScriptBlock]::Create(${Function:Test-Message}.Ast.Extent.Text)) | |
#Act: Execute scripts | |
$global:results = Remotely {Test-Message} | |
#Assert | |
$results.GetError() | Should Be $null | |
$results.GetVerbose() | Should Be "Test Message" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment