skip.ps1
<#PSScriptInfo .VERSION 1.0 .GUID f6f03263-9983-468e-8935-3bf2c3670854 .AUTHOR Jeffrey Snover .COMPANYNAME Microsoft .COPYRIGHT .TAGS .LICENSEURI .PROJECTURI .ICONURI .EXTERNALMODULEDEPENDENCIES .REQUIREDSCRIPTS .EXTERNALSCRIPTDEPENDENCIES .RELEASENOTES #> <# .DESCRIPTION Skip a number of objects in a stgream #> param( [Parameter()] $Count = 1, [Parameter(ValueFromPipeline=$true)] $InputObject ) Begin { $ObjectCount = 0 } Process { $ObjectCount++ if ($ObjectCount -gt $Count) { Write-Output $InputObject }else { Write-Verbose "Skipping $ObjectCount : $Inputobject" } } |