Skip to content

Instantly share code, notes, and snippets.

@altrive
Created May 9, 2015 04:38
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save altrive/1d2ada60a3c74e3fb011 to your computer and use it in GitHub Desktop.
Save altrive/1d2ada60a3c74e3fb011 to your computer and use it in GitHub Desktop.
Remotely PowerShell Module Tests
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