Forum Discussion

tcboeira's avatar
tcboeira
Brass Contributor
Oct 19, 2022

Is the use of "$psitem" correct?

Hello friends,   First of all, I apologize for the words, but I don't speak English and I rely on an online translator.   Well, I have a doubt and I believe it is of orientation. Still learning t...
  • tcboeira's avatar
    tcboeira
    Dec 15, 2022

    Olá Amigos...

     

    Eu descobri como "se livrar" de conteúdo indesejado na tela.

    No final da linha, uso uma referência ao objeto que desejo que seja exibido "| Select-Object -ExpandProperty 'NomeObjeto' " ...

     

    O Script na pergunta tem esta aparência:

     

    $CSV = Import-Csv .\Lista-SITEGRP.csv
    $CSV. Conte
    $CSV. | do proprietário ForEach-Object {
    Get-UnifiedGroup -Identity $_ | ForEach-Object -Process {[PSCustomObject][Ordered]@{

    Url = $PSItem.SharePointSiteUrl'Owner
    ' = $PSItem.ManagedBy -join ", "
    'StorageQuota' = Get-SPOSite -Identity $_. | SharePointSiteUrl Select-Object -Property @{Name = 'StorageQuota'; Expression={ $PSItem.StorageQuota}} | Select-object -expandProperty 'StorageQuota''StorageUsageCurrent'
    = Get-SPOSite -Identity $_. | SharePointSiteUrl Select-Object -Property @{Name = 'StorageUsageCurrent'; Expression={ $PSItem.StorageUsageCurrent}} | Select-object -expandProperty 'StorageUsageCurrent''Template'
    = Get-SPOSite -Identity $_. | SharePointSiteUrl Select-Object -Property @{Name = 'Template'; Expression={ $PSItem.Template}} | Select-Object -ExpandProperty 'Template''LocaleId'
    = Get-SPOSite -Identity $_. | SharePointSiteUrl Select-Object -Property @{Name = 'LocaleId'; Expression={ $PSItem.LocaleId}} | Select-Object -ExpandProperty 'LocaleId'

    }
    }
    }

     

     

    Muito obrigado a todos pela vossa ajuda e atenção!!!
    Grande abraço