Powershell - Object

Windows Powershell Menu

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"})





Discover More
Windows Powershell Menu
PowerShell - File System

in Powershell From the file system From a variable (with the GetFileNameWithoutExtension and GetExtension static methods from the System.IO.Path...



Share this page:
Follow us:
Task Runner