Created
August 17, 2020 00:29
-
-
Save brettmillerb/63efae0f1db5c8ccbdefa4519bf62a38 to your computer and use it in GitHub Desktop.
CFP MBCrump
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-DivisibleByThree { | |
[CmdletBinding()] | |
[OutputType([String])] | |
Param ( | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true)] | |
$String | |
) | |
process { | |
if ((($_ -replace '[^0]').length % 3) -eq 0) { | |
'divisible by three' | |
} | |
else { | |
'not divisible' | |
} | |
} | |
} | |
Get-ChildItem -Path $file | % { | |
$_ | Test-DivisibleByThree | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment