Skip to content

Instantly share code, notes, and snippets.

@bielawb
Created July 12, 2017 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bielawb/bd0f5432e786b4107a2f9c502bb9fc6d to your computer and use it in GitHub Desktop.
Save bielawb/bd0f5432e786b4107a2f9c502bb9fc6d to your computer and use it in GitHub Desktop.
Maskujemy Write-Host tylko jeśli...
Describe 'Nadpisujemy Write-Host' {
Mock -CommandName Write-Host -MockWith {
Write-Warning -Message $Object
} -ParameterFilter {
$Object -match '^Nadpisz'
}
Write-Host -Object 'Nie nadpisuj...'
Write-Host -Object 'Nadpisz mnie!'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment