Exporting dataRow to a csv - powershell

I have run a MySQL Query, which has given me a resultset that I can work with.
However, I now need to export it to a CSV file.
If I run
$result1 | export-csv "c:\path\to\csv.csv"
I get a file with a single entry in the first cell only:
#TYPE System.Int32
But there should be apx 6000 rows.
If I do
$result1 | Get-member
I get:
TypeName: System.Int32
Name MemberType Definition
---- ---------- ----------
CompareTo Method int CompareTo(System.Object value), int CompareTo(int value)
Equals Method bool Equals(System.Object obj), bool Equals(int obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
GetTypeCode Method System.TypeCode GetTypeCode()
ToString Method string ToString(), string ToString(string format), string ToString(System.IFormatP...
TypeName: System.Data.DataRow
Name MemberType Definition
---- ---------- ----------
AcceptChanges Method System.Void AcceptChanges()
BeginEdit Method System.Void BeginEdit()
CancelEdit Method System.Void CancelEdit()
ClearErrors Method System.Void ClearErrors()
Delete Method System.Void Delete()
EndEdit Method System.Void EndEdit()
Equals Method bool Equals(System.Object obj)
GetChildRows Method System.Data.DataRow[] GetChildRows(string relationName), System.D...
GetColumnError Method string GetColumnError(int columnIndex), string GetColumnError(str...
GetColumnsInError Method System.Data.DataColumn[] GetColumnsInError()
GetHashCode Method int GetHashCode()
GetParentRow Method System.Data.DataRow GetParentRow(string relationName), System.Dat...
GetParentRows Method System.Data.DataRow[] GetParentRows(string relationName), System....
GetType Method type GetType()
HasVersion Method bool HasVersion(System.Data.DataRowVersion version)
IsNull Method bool IsNull(int columnIndex), bool IsNull(string columnName), boo...
RejectChanges Method System.Void RejectChanges()
SetAdded Method System.Void SetAdded()
SetColumnError Method System.Void SetColumnError(int columnIndex, string error), System...
SetModified Method System.Void SetModified()
SetParentRow Method System.Void SetParentRow(System.Data.DataRow parentRow), System.V...
ToString Method string ToString()
Item ParameterizedProperty System.Object Item(int columnIndex) {get;set;}, System.Object Ite...
CJ Property System.UInt64 CustomerJobId {get;set;}
End Property System.DateTime Endtime {get;set;}
Name Property System.String Engineer {get;set;}
JN Property System.String Jobname {get;set;}
Start Property System.DateTime Starttime {get;set;}
What's the correct way to convert this to a CSV file?
write-host $result1 gives me data similar to the below:
CJ :
JN :
Name : Mr Smith
Start :
End :
CJ : 987654321
JN :
Name : Mr Jones
Starttime : 29/09/2015 08:00:00
Endtime : 29/09/2015 08:30:00

I have found a way to make this work, by creating a PSObject, and then converting that to CSV.
$a = 0
$data = #()
foreach($res in $result1)
{
if($a -eq 0)
{
#Do Nothing
}
else
{
$cj = $res.CJ
$jn = $res.JN
$en = $res.Name
$st = $res.Start
$et = $res.End
#write-host "$cj,$jn,$en,$st,$et"
$row = New-Object PSObject
$row | Add-Member -MemberType NoteProperty -Name "CJ" -Value $cj -force
$row | Add-Member -MemberType NoteProperty -Name "JN" -Value $jn -force
$row | Add-Member -MemberType NoteProperty -Name "Name" -Value $en -force
$row | Add-Member -MemberType NoteProperty -Name "Start" -Value $st -force
$row | Add-Member -MemberType NoteProperty -Name "End" -Value $et -force
$data += $row
}
$a++
}
$data | Export-Csv "c:\path\to\csv.csv" -NoTypeInformation

Related

How to Export Clustered Scheduled Task

I try to export the XML of a Clustered Scheduled Task.
I search for the function as Export-ScheduledTask has for non Clustered Tasks.
Maybe there is a way via CIM when i execute a Get-ClusteredScheduledTask I get this.
But I have no idea how to query this
CimClass : Root/Microsoft/Windows/TaskScheduler:MSFT_ClusteredScheduledTask
CimInstanceProperties : {ClusterName, CurrentOwner, Resource, TaskDefinition...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties
Edit1:
Get-Member
$task | Get-Member
TypeName: Microsoft.Management.Infrastructure.CimInstance#Root/Microsoft/Windows/TaskScheduler/MSFT_ClusteredScheduledTask
Name MemberType Definition
---- ---------- ----------
Clone Method System.Object ICloneable.Clone()
Dispose Method void Dispose(), void IDisposable.Dispose()
Equals Method bool Equals(System.Object obj)
GetCimSessionComputerName Method string GetCimSessionComputerName()
GetCimSessionInstanceId Method guid GetCimSessionInstanceId()
GetHashCode Method int GetHashCode()
GetObjectData Method void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context...
GetType Method type GetType()
ToString Method string ToString()
ClusterName Property string ClusterName {get;}
CurrentOwner Property string CurrentOwner {get;}
PSComputerName Property string PSComputerName {get;}
Resource Property string Resource {get;}
TaskDefinition Property CimInstance#Instance TaskDefinition {get;set;}
TaskName Property string TaskName {get;}
TaskType ScriptProperty System.Object TaskType {get=[Microsoft.PowerShell.Cmdletization.GeneratedTypes.ScheduledTask.ClusterTaskTypeEnum]($this.PSBas...
Try This
$TaskName = "Change_NTFS_permissions"
Get-ChildItem -Path ($env:SystemRoot +
'\System32\Tasks\Microsoft\Windows\Failover Clustering')
-File -Recurse | ? {$_.Name -like $TaskName} | Get-Content |
Out-File -FilePath ('C:\scripts\XML_Shedules' + '\' + $TaskName + '.xml')

How to query Powershell cmdlet parameter values

How can I get a list possible values of cmdlet parameter programmatically?
E.g for New-Item -Type:
File
Directory
SymbolicLink
Junction
HardLink
Get-Help New-Item -Full
Get-Command New-Item | select *
You can also check the online documentation (e.g. New-Item).
Or you can use
(Get-Command -Name new-item).parametersets
as suggested by vonPryz above.
For "Get-" cmdlets I usually create an object and then do a Get-Member to retrieve the definition of the members.
e.g.
$item = Get-Item .\test.csv
$item | Get-Member
TypeName: System.IO.FileInfo
Name MemberType Definition
---- ---------- ----------
LinkType CodeProperty System.String LinkType{get=GetLinkType;}
Mode CodeProperty System.String Mode{get=Mode;}
Target CodeProperty System.Collections.Generic.IEnumerable`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] Target{get=GetTarget;}
AppendText Method System.IO.StreamWriter AppendText()
CopyTo Method System.IO.FileInfo CopyTo(string destFileName), System.IO.FileInfo CopyTo(string destFileName, bool overwrite)
Create Method System.IO.FileStream Create()
CreateObjRef Method System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
CreateText Method System.IO.StreamWriter CreateText()
Decrypt Method void Decrypt()
Delete Method void Delete()
Encrypt Method void Encrypt()
Equals Method bool Equals(System.Object obj)
GetAccessControl Method System.Security.AccessControl.FileSecurity GetAccessControl(), System.Security.AccessControl.FileSecurity GetAccessControl(System.Security.AccessControl.AccessControlSections includeSections)
GetHashCode Method int GetHashCode()
GetLifetimeService Method System.Object GetLifetimeService()
GetObjectData Method void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context), void ISerializable.GetObjectData(System.Runtime.Serialization.Se...
GetType Method type GetType()
InitializeLifetimeService Method System.Object InitializeLifetimeService()
MoveTo Method void MoveTo(string destFileName)
Open Method System.IO.FileStream Open(System.IO.FileMode mode), System.IO.FileStream Open(System.IO.FileMode mode, System.IO.FileAccess access), System.IO.FileStream Open(System.IO.FileMode mode, System.I...
OpenRead Method System.IO.FileStream OpenRead()
OpenText Method System.IO.StreamReader OpenText()
OpenWrite Method System.IO.FileStream OpenWrite()
Refresh Method void Refresh()
Replace Method System.IO.FileInfo Replace(string destinationFileName, string destinationBackupFileName), System.IO.FileInfo Replace(string destinationFileName, string destinationBackupFileName, bool ignoreMe...
SetAccessControl Method void SetAccessControl(System.Security.AccessControl.FileSecurity fileSecurity)
ToString Method string ToString()
PSChildName NoteProperty string PSChildName=test.csv
PSDrive NoteProperty PSDriveInfo PSDrive=C
PSIsContainer NoteProperty bool PSIsContainer=False
PSParentPath NoteProperty string PSParentPath=Microsoft.PowerShell.Core\FileSystem::C:\test
PSPath NoteProperty string PSPath=Microsoft.PowerShell.Core\FileSystem::C:\test\test.csv
PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem
Attributes Property System.IO.FileAttributes Attributes {get;set;}
CreationTime Property datetime CreationTime {get;set;}
CreationTimeUtc Property datetime CreationTimeUtc {get;set;}
Directory Property System.IO.DirectoryInfo Directory {get;}
DirectoryName Property string DirectoryName {get;}
Exists Property bool Exists {get;}
Extension Property string Extension {get;}
FullName Property string FullName {get;}
IsReadOnly Property bool IsReadOnly {get;set;}
LastAccessTime Property datetime LastAccessTime {get;set;}
LastAccessTimeUtc Property datetime LastAccessTimeUtc {get;set;}
LastWriteTime Property datetime LastWriteTime {get;set;}
LastWriteTimeUtc Property datetime LastWriteTimeUtc {get;set;}
Length Property long Length {get;}
Name Property string Name {get;}
BaseName ScriptProperty System.Object BaseName {get=if ($this.Extension.Length -gt 0){$this.Name.Remove($this.Name.Length - $this.Extension.Length)}else{$this.Name};}
VersionInfo ScriptProperty System.Object VersionInfo {get=[System.Diagnostics.FileVersionInfo]::GetVersionInfo($this.FullName);}

Members of CimClass is different through pipeline

I would have expected to get the same "type" from both of the following commands. The second prepends the type name with "Selected."
>(Get-CimInstance CIM_LogicalDisk).CimClass | gm
TypeName: Microsoft.Management.Infrastructure.CimClass
Name MemberType Definition
---- ---------- ----------
Dispose Method void Dispose(), void IDisposable.Dispose()
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
CimClassMethods Property Microsoft.Management.Infrastructure.Generic.CimReadOnlyKeyedCollection[Microsoft.M
CimClassProperties Property Microsoft.Management.Infrastructure.Generic.CimReadOnlyKeyedCollection[Microsoft.M
CimClassQualifiers Property Microsoft.Management.Infrastructure.Generic.CimReadOnlyKeyedCollection[Microsoft.M
CimSuperClass Property cimclass CimSuperClass {get;}
CimSuperClassName Property string CimSuperClassName {get;}
CimSystemProperties Property Microsoft.Management.Infrastructure.CimSystemProperties CimSystemProperties {get;}
CimClassName ScriptProperty System.String CimClassName {get=[OutputType([string])]...
The second reveals a different type.
>Get-CimInstance CIM_LogicalDisk | Select-Object -Property CimClass | gm
TypeName: Selected.Microsoft.Management.Infrastructure.CimInstance
Name MemberType Definition
---- ---------- ----------
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetType Method type GetType()
ToString Method string ToString()
CimClass NoteProperty cimclass CimClass=root/cimv2:Win32_MappedLogicalDisk
>$PSVersionTable.PSVersion.ToString()
5.1.14409.1018
Using Select-Object with the -Property parameter outputs an object with the selected properties.
To get a "bare" property value, use the -ExpandProperty parameter instead.
Get-CimInstance CIM_LogicalDisk | Select-Object -ExpandProperty CimClass | gm

How to get users that sync type is cloud and get their license information in o365 - Powershell

The code below shows the users with licenses but I need to know what their sync type is as well and I am unsure how to get that information
# Connect to o365 tenant
Connect-MsolService
# Get all users in o365 and get license information
$groupOfUsers = Get-MsolUser -all
$results = foreach ($user in $groupOfUsers) {
$licenses = $user.licenses.accountskuid
foreach ($license in $licenses) {
[pscustomobject]#{
UPN = $user.userprincipalname
License = $license
}
}
}
# Export the results to csv
$results | Export-Csv c:\scripts\UsersWitho365licenses.csv -NoTypeInformation
Everything in Powershell is an object, therefore, it has methods and properties, and as LotPings commented,
Get-MsolUser | Get-Member
But this is an array which may differ on the properties an methods you will be able to use in the foreach. Try this (I will do it with FileItems as I don't have that module):
cd $HOME
$files = Get-ChildItem
$files | Get-Member
Result:
TypeName: System.IO.DirectoryInfo
Name MemberType Definition
---- ---------- ----------
LinkType CodeProperty System.String LinkType{get=GetLinkType;}
Mode CodeProperty System.String Mode{get=Mode;}
Target CodeProperty System.Collections.Generic.IEnumerable`1[[System.String, mscorlib, Version=4.0.0...
Create Method void Create(), void Create(System.Security.AccessControl.DirectorySecurity direc...
CreateObjRef Method System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
CreateSubdirectory Method System.IO.DirectoryInfo CreateSubdirectory(string path), System.IO.DirectoryInfo...
Delete Method void Delete(), void Delete(bool recursive)
EnumerateDirectories Method System.Collections.Generic.IEnumerable[System.IO.DirectoryInfo] EnumerateDirecto...
EnumerateFiles Method System.Collections.Generic.IEnumerable[System.IO.FileInfo] EnumerateFiles(), Sys...
EnumerateFileSystemInfos Method System.Collections.Generic.IEnumerable[System.IO.FileSystemInfo] EnumerateFileSy...
Equals Method bool Equals(System.Object obj)
GetAccessControl Method System.Security.AccessControl.DirectorySecurity GetAccessControl(), System.Secur...
GetDirectories Method System.IO.DirectoryInfo[] GetDirectories(), System.IO.DirectoryInfo[] GetDirecto...
GetFiles Method System.IO.FileInfo[] GetFiles(string searchPattern), System.IO.FileInfo[] GetFil...
GetFileSystemInfos Method System.IO.FileSystemInfo[] GetFileSystemInfos(string searchPattern), System.IO.F...
GetHashCode Method int GetHashCode()
GetLifetimeService Method System.Object GetLifetimeService()
GetObjectData Method void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.R...
GetType Method type GetType()
InitializeLifetimeService Method System.Object InitializeLifetimeService()
MoveTo Method void MoveTo(string destDirName)
Refresh Method void Refresh()
SetAccessControl Method void SetAccessControl(System.Security.AccessControl.DirectorySecurity directoryS...
ToString Method string ToString()
PSChildName NoteProperty string PSChildName=.dotnet
PSDrive NoteProperty PSDriveInfo PSDrive=C
PSIsContainer NoteProperty bool PSIsContainer=True
PSParentPath NoteProperty string PSParentPath=Microsoft.PowerShell.Core\FileSystem::C:\Users\Ras_T
PSPath NoteProperty string PSPath=Microsoft.PowerShell.Core\FileSystem::C:\Users\Ras_T\.dotnet
PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem
Attributes Property System.IO.FileAttributes Attributes {get;set;}
CreationTime Property datetime CreationTime {get;set;}
CreationTimeUtc Property datetime CreationTimeUtc {get;set;}
Exists Property bool Exists {get;}
Extension Property string Extension {get;}
FullName Property string FullName {get;}
LastAccessTime Property datetime LastAccessTime {get;set;}
LastAccessTimeUtc Property datetime LastAccessTimeUtc {get;set;}
LastWriteTime Property datetime LastWriteTime {get;set;}
LastWriteTimeUtc Property datetime LastWriteTimeUtc {get;set;}
Name Property string Name {get;}
Parent Property System.IO.DirectoryInfo Parent {get;}
Root Property System.IO.DirectoryInfo Root {get;}
BaseName ScriptProperty System.Object BaseName {get=$this.Name;}
TypeName: System.IO.FileInfo
Name MemberType Definition
---- ---------- ----------
LinkType CodeProperty System.String LinkType{get=GetLinkType;}
Mode CodeProperty System.String Mode{get=Mode;}
Target CodeProperty System.Collections.Generic.IEnumerable`1[[System.String, mscorlib, Version=4.0.0...
AppendText Method System.IO.StreamWriter AppendText()
CopyTo Method System.IO.FileInfo CopyTo(string destFileName), System.IO.FileInfo CopyTo(string...
Create Method System.IO.FileStream Create()
CreateObjRef Method System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
CreateText Method System.IO.StreamWriter CreateText()
Decrypt Method void Decrypt()
Delete Method void Delete()
Encrypt Method void Encrypt()
Equals Method bool Equals(System.Object obj)
GetAccessControl Method System.Security.AccessControl.FileSecurity GetAccessControl(), System.Security.A...
GetHashCode Method int GetHashCode()
GetLifetimeService Method System.Object GetLifetimeService()
GetObjectData Method void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.R...
GetType Method type GetType()
InitializeLifetimeService Method System.Object InitializeLifetimeService()
MoveTo Method void MoveTo(string destFileName)
Open Method System.IO.FileStream Open(System.IO.FileMode mode), System.IO.FileStream Open(Sy...
OpenRead Method System.IO.FileStream OpenRead()
OpenText Method System.IO.StreamReader OpenText()
OpenWrite Method System.IO.FileStream OpenWrite()
Refresh Method void Refresh()
Replace Method System.IO.FileInfo Replace(string destinationFileName, string destinationBackupF...
SetAccessControl Method void SetAccessControl(System.Security.AccessControl.FileSecurity fileSecurity)
ToString Method string ToString()
PSChildName NoteProperty string PSChildName=.bash_history
PSDrive NoteProperty PSDriveInfo PSDrive=C
PSIsContainer NoteProperty bool PSIsContainer=False
PSParentPath NoteProperty string PSParentPath=Microsoft.PowerShell.Core\FileSystem::C:\Users\Ras_T
PSPath NoteProperty string PSPath=Microsoft.PowerShell.Core\FileSystem::C:\Users\Ras_T\.bash_history
PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem
Attributes Property System.IO.FileAttributes Attributes {get;set;}
CreationTime Property datetime CreationTime {get;set;}
CreationTimeUtc Property datetime CreationTimeUtc {get;set;}
Directory Property System.IO.DirectoryInfo Directory {get;}
DirectoryName Property string DirectoryName {get;}
Exists Property bool Exists {get;}
Extension Property string Extension {get;}
FullName Property string FullName {get;}
IsReadOnly Property bool IsReadOnly {get;set;}
LastAccessTime Property datetime LastAccessTime {get;set;}
LastAccessTimeUtc Property datetime LastAccessTimeUtc {get;set;}
LastWriteTime Property datetime LastWriteTime {get;set;}
LastWriteTimeUtc Property datetime LastWriteTimeUtc {get;set;}
Length Property long Length {get;}
Name Property string Name {get;}
BaseName ScriptProperty System.Object BaseName {get=if ($this.Extension.Length -gt 0){$this.Name.Remove(...
VersionInfo ScriptProperty System.Object VersionInfo {get=[System.Diagnostics.FileVersionInfo]::GetVersionI...
But You don't care about all that you just want the properties, you can get them like this:
$fileItem = $files[0]
$fileItem | Get-Member -
Result:
TypeName: System.IO.DirectoryInfo
Name MemberType Definition
---- ---------- ----------
LinkType CodeProperty System.String LinkType{get=GetLinkType;}
Mode CodeProperty System.String Mode{get=Mode;}
Target CodeProperty System.Collections.Generic.IEnumerable`1[[System.String, mscorlib, Version=4.0.0.0, Cult...
PSChildName NoteProperty string PSChildName=.dotnet
PSDrive NoteProperty PSDriveInfo PSDrive=C
PSIsContainer NoteProperty bool PSIsContainer=True
PSParentPath NoteProperty string PSParentPath=Microsoft.PowerShell.Core\FileSystem::C:\Users\Ras_T
PSPath NoteProperty string PSPath=Microsoft.PowerShell.Core\FileSystem::C:\Users\Ras_T\.dotnet
PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem
Attributes Property System.IO.FileAttributes Attributes {get;set;}
CreationTime Property datetime CreationTime {get;set;}
CreationTimeUtc Property datetime CreationTimeUtc {get;set;}
Exists Property bool Exists {get;}
Extension Property string Extension {get;}
FullName Property string FullName {get;}
LastAccessTime Property datetime LastAccessTime {get;set;}
LastAccessTimeUtc Property datetime LastAccessTimeUtc {get;set;}
LastWriteTime Property datetime LastWriteTime {get;set;}
LastWriteTimeUtc Property datetime LastWriteTimeUtc {get;set;}
Name Property string Name {get;}
Parent Property System.IO.DirectoryInfo Parent {get;}
Root Property System.IO.DirectoryInfo Root {get;}
BaseName ScriptProperty System.Object BaseName {get=$this.Name;}
One of the properties in the output of Get-Member should be what you are looking for.

powershell - How to select NoteProperty that has brackets in its Name

I have powershell code that pulls groupinfo from SCOM
$d = Get-SCOMAlert -Criteria "Id = 'ab0b795c-3564-406c-b6d5-257b8788eefb"
$d|fl
[Microsoft.Windows.Server.LogicalDisk].FileSystem : NTFS
[Microsoft.Windows.Server.LogicalDisk].Compressed : False
[Microsoft.Windows.Server.LogicalDisk].Size : 146780712960
[Microsoft.Windows.Server.LogicalDisk].SizeNumeric : 139981
[IsManaged : True
HealthState : Success
StateLastModified : 6/28/2013 12:53:41 PM
IsAvailable : True
AvailabilityLastModified : 7/2/2013 2:40:35 PM
DisplayName : C:
....
I can see the [Microsoft.Windows.Server.LogicalDisk].FileSystem noteproperty
if i use a wild card in my select statement
$d | select healthstate, *filesystem, id |fl
HealthState : Success
[Microsoft.Windows.Server.LogicalDisk].FileSystem : NTFS
Id : 4dfb9975-5815-a950-16ff-086f5e58e8d5
But I can't figure out how to select it directly like
$d.[Microsoft.Windows.Server.LogicalDisk].FileSystem
please advise
Here is output from d$ | get-member
TypeName: Microsoft.EnterpriseManagement.Monitoring.MonitoringObject
Name MemberType Definition
---- ---------- ----------
OnRelatedEntitiesChanged Event System.EventHandler`1[Microsoft.Ent...
ApplyTemplate Method System.Void ApplyTemplate(Microsoft...
BeginExecuteMonitoringTask Method System.IAsyncResult BeginExecuteMon...
Commit Method System.Void Commit(Microsoft.Enterp...
ContainsProperty Method bool ContainsProperty(Microsoft.Ent...
CreateNavigator Method System.Xml.XPath.XPathNavigator Cre...
EndExecuteMonitoringTask Method System.Collections.ObjectModel.Read...
Equals Method bool Equals(System.Object obj)
ExecuteMonitoringTask Method System.Collections.ObjectModel.Read...
GetClasses Method System.Collections.Generic.IList[Mi...
GetCopy Method Microsoft.EnterpriseManagement.Comm...
GetDiscoverySources Method System.Collections.ObjectModel.Read...
GetHashCode Method int GetHashCode()
GetLeastDerivedNonAbstractClass Method Microsoft.EnterpriseManagement.Conf...
GetLeastDerivedNonAbstractMonitoringClass Method Microsoft.EnterpriseManagement.Conf...
GetMaintenanceWindow Method Microsoft.EnterpriseManagement.Moni...
GetMaintenanceWindowHistory Method System.Collections.ObjectModel.Read...
GetMonitorHierarchy Method Microsoft.EnterpriseManagement.Comm...
GetMonitoringAlertReader Method Microsoft.EnterpriseManagement.Moni...
GetMonitoringAlerts Method System.Collections.ObjectModel.Read...
GetMonitoringAlertsCount Method int GetMonitoringAlertsCount(), int...
GetMonitoringClasses Method System.Collections.ObjectModel.Read...
GetMonitoringConsoleTasks Method System.Collections.ObjectModel.Read...
GetMonitoringDiagnostics Method System.Collections.ObjectModel.Read...
GetMonitoringDiscoveries Method System.Collections.ObjectModel.Read...
GetMonitoringEventReader Method Microsoft.EnterpriseManagement.Moni...
GetMonitoringEvents Method System.Collections.ObjectModel.Read...
GetMonitoringLinkedReports Method System.Collections.ObjectModel.Read...
GetMonitoringPerformanceData Method System.Collections.ObjectModel.Read...
GetMonitoringPerformanceDataReader Method Microsoft.EnterpriseManagement.Moni...
GetMonitoringProperties Method System.Collections.ObjectModel.Read...
GetMonitoringPropertyValue Method System.Object GetMonitoringProperty...
GetMonitoringRecoveries Method System.Collections.ObjectModel.Read...
GetMonitoringRelationshipObjects Method System.Collections.ObjectModel.Read...
GetMonitoringRelationshipObjectsWhereSource Method System.Collections.ObjectModel.Read...
GetMonitoringRelationshipObjectsWhereTarget Method System.Collections.ObjectModel.Read...
GetMonitoringReports Method System.Collections.ObjectModel.Read...
GetMonitoringRules Method System.Collections.ObjectModel.Read...
GetMonitoringStateHierarchy Method Microsoft.EnterpriseManagement.Comm...
GetMonitoringStates Method System.Collections.Generic.IList[Mi...
GetMonitoringTaskResults Method System.Collections.ObjectModel.Read...
GetMonitoringTasks Method System.Collections.ObjectModel.Read...
GetMonitoringViews Method System.Collections.ObjectModel.Read...
GetMostDerivedClasses Method System.Collections.Generic.IList[Mi...
GetMostDerivedMonitoringClasses Method System.Collections.ObjectModel.Read...
GetParentMonitoringObjects Method System.Collections.ObjectModel.Read...
GetParentPartialMonitoringObjects Method System.Collections.ObjectModel.Read...
GetProperties Method System.Collections.Generic.IList[Mi...
GetRelatedMonitoringObjects Method System.Collections.ObjectModel.Read...
GetRelatedPartialMonitoringObjects Method System.Collections.ObjectModel.Read...
GetResultantCategoryOverrides Method Microsoft.EnterpriseManagement.Conf...
GetResultantOverrides Method Microsoft.EnterpriseManagement.Conf...
GetStateHierarchy Method Microsoft.EnterpriseManagement.Comm...
GetType Method type GetType()
InsertCustomMonitoringEvent Method System.Void InsertCustomMonitoringE...
InsertCustomMonitoringEvents Method System.Void InsertCustomMonitoringE...
InsertCustomMonitoringPerformanceData Method System.Void InsertCustomMonitoringP...
IsInstanceOf Method bool IsInstanceOf(Microsoft.Enterpr...
Overwrite Method System.Void Overwrite(Microsoft.Ent...
PopulateAccessRights Method System.Void PopulateAccessRights(Mi...
RecalculateMonitoringState Method Microsoft.EnterpriseManagement.Runt...
Reconnect Method System.Void Reconnect(Microsoft.Ent...
ResetMonitoringState Method Microsoft.EnterpriseManagement.Runt...
ScheduleMaintenanceMode Method System.Void ScheduleMaintenanceMode...
StopMaintenanceMode Method System.Void StopMaintenanceMode(Sys...
SubmitMonitoringTask Method System.Guid SubmitMonitoringTask(Mi...
ToString Method string ToString()
TryGetProperty Method bool TryGetProperty(Microsoft.Enter...
UpdateMaintenanceMode Method System.Void UpdateMaintenanceMode(S...
[Microsoft.Windows.Computer].PrincipalName NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.LogicalDevice].Description NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.LogicalDevice].DeviceID NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.LogicalDevice].Name NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.LogicalDisk].VolumeName NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.Server.LogicalDisk].Compressed NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.Server.LogicalDisk].DriveType NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.Server.LogicalDisk].FileSystem NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.Server.LogicalDisk].QuotasDisabled NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.Server.LogicalDisk].Size NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.Server.LogicalDisk].SizeNumeric NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.Server.LogicalDisk].SupportsDiskQuota NoteProperty Microsoft.EnterpriseManagement.Comm...
[Microsoft.Windows.Server.LogicalDisk].SupportsFileBasedCompression NoteProperty Microsoft.EnterpriseManagement.Comm...
[System.ConfigItem].AssetStatus NoteProperty Microsoft.EnterpriseManagement.Comm...
[System.ConfigItem].Notes NoteProperty Microsoft.EnterpriseManagement.Comm...
[System.ConfigItem].ObjectStatus NoteProperty Microsoft.EnterpriseManagement.Comm...
[System.Entity].DisplayName NoteProperty Microsoft.EnterpriseManagement.Comm...
Item ParameterizedProperty Microsoft.EnterpriseManagement.Comm...
AvailabilityLastModified Property System.Nullable`1[[System.DateTime,...
DisplayName Property System.String DisplayName {get;}
FullName Property System.String FullName {get;}
HasChanges Property System.Boolean HasChanges {get;}
HealthState Property Microsoft.EnterpriseManagement.Conf...
Id Property System.Guid Id {get;set;}
InMaintenanceMode Property System.Boolean InMaintenanceMode {g...
IsAvailable Property System.Boolean IsAvailable {get;}
IsManaged Property System.Boolean IsManaged {get;}
IsNew Property System.Boolean IsNew {get;}
LastModified Property System.DateTime LastModified {get;}
LastModifiedBy Property System.Nullable`1[[System.Guid, msc...
LeastDerivedNonAbstractManagementPackClassId Property System.Guid LeastDerivedNonAbstract...
LeastDerivedNonAbstractMonitoringClassId Property System.Guid LeastDerivedNonAbstract...
MaintenanceModeLastModified Property System.Nullable`1[[System.DateTime,...
ManagementGroup Property Microsoft.EnterpriseManagement.Mana...
ManagementGroupId Property System.Guid ManagementGroupId {get;}
ManagementPackClassIds Property System.Collections.Generic.IList`1[...
MonitoringClassIds Property System.Collections.ObjectModel.Read...
Name Property System.String Name {get;}
Path Property System.String Path {get;}
StateLastModified Property System.Nullable`1[[System.DateTime,...
TimeAdded Property System.DateTime TimeAdded {get;}
Values Property System.Collections.Generic.IList`1[...
A couple of approaches. You can wrap the property name in a string:
$d.'[Microsoft.Windows.Server.LogicalDisk].FileSystem'
Or, you can save the property name to a variable:
$propertyName = '[Microsoft.Windows.Server.LogicalDisk].FileSystem'
$d.$propertyName