#PowerShell HowTo get the property of the object from the previous pipe level

[System.Reflection.Assembly]::LoadWithPartialName(”Microsoft.SharePoint”) function Get-SPSite{ $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local $farm.services | % {if($_.WebApplications.Count){$_.WebApplications}} | % {if($_.sites.Count){$_.sites}} } function Get-SPUser { process { $_ | Add-Member -memberType NoteProperty -name “Site” -value $Site.Url $_ | Add-Member -memberType NoteProperty -name “Title” -value $Site.RootWeb.Title $_ | Add-Member -memberType NoteProperty -name “Group” -value $Group.Name $_ } } Get-SPSite | % {$Site = $_;$_.RootWeb.Groups}Continue reading “#PowerShell HowTo get the property of the object from the previous pipe level”

PowerShell trick

Do you know how to change the script below to make it true? ((‘first’,’second’))[0][1] -eq ((‘first’,’second’),(‘first’,’second’))[0][1] I want to get ‘second‘ from the left operand ((‘first’,’second’))[0][1] (,(‘first’,’second’))[0][1] comma is not a solution as it will not work for (,(‘first’,’second’),(‘first’,’second’))[0][1] (,(‘first’,’second’))[0][1] -eq (,(‘first’,’second’),(‘first’,’second’))[0][1] will still return False