Powershell - Object
Management
Type
$foo="1"
$foo.GetType()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
Access
Get-ChildItem $sourceDir -Filter *.zip |
Foreach-Object {
echo $_.FullName
echo $_.Name
}
Property exist
$myObject.PSobject.Properties.Name -contains "myPropertyNameToTest"
[bool]($myObject.PSobject.Properties.name -match "myPropertyNameToTest")
[bool]($file.psobject.Properties | where { $_.Name -eq "myPropertyNameToTest"})