Skip to content

Instantly share code, notes, and snippets.

@dfch
Last active February 5, 2016 04:09
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 dfch/0ebe5d7702958bbca6c1 to your computer and use it in GitHub Desktop.
Save dfch/0ebe5d7702958bbca6c1 to your computer and use it in GitHub Desktop.
help Should
function Should {
[CmdletBinding(
SupportsShouldProcess = $false
,
ConfirmImpact = 'Low'
)]
Param
(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
$InputObject
,
[Parameter(Mandatory = $false, Position = 0)]
$Arg0
,
[Parameter(Mandatory = $false, Position = 1)]
$Arg1
,
[Parameter(Mandatory = $false, Position = 2)]
$Arg2
,
[Parameter(Mandatory = $false, Position = 3)]
$Arg3
,
[Parameter(Mandatory = $false, Position = 4)]
$Arg4
,
[Parameter(Mandatory = $false, Position = 5)]
$Arg5
)
BEGIN
{
}
PROCESS
{
$callStack = Get-PSCallStack;
Write-Host -ForegroundColor Red -Object ($callStack[0].InvocationInfo.Line);
Write-Host '';
Write-Host -ForegroundColor Yellow -Object ("Asserted type: '{0}'" -f $InputObject.GetType().FullName);
Write-Host '';
Write-Host -ForegroundColor Gray -Object ("Asserted content:`r`n###`r`n{0}###" -f ($InputObject | Out-String));
Write-Host '';
}
END
{
}
}
#
# Copyright 2015 d-fens GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment