| 123456789101112131415161718192021222324252627282930313233 |
- param (
- [Parameter(ValueFromPipeline)]
- $InputObject
- )
- process
- {
- if ($null -eq $InputObject) { return $null }
- if ($InputObject -is [System.Collections.IEnumerable] -and $InputObject -isnot [string])
- {
- $collection = @(
- foreach ($object in $InputObject) { &$PSCommandPath $object }
- )
- Write-Output -NoEnumerate $collection
- }
- elseif ($InputObject -is [psobject])
- {
- $hash = @{}
- foreach ($property in $InputObject.PSObject.Properties)
- {
- $hash[$property.Name] = (&$PSCommandPath $property.Value).PSObject.BaseObject
- }
- $hash
- }
- else
- {
- $InputObject
- }
- }
|