Jean-François Guénet
asked on
Exchange Powershell Help
How can i retreive only the value "Calendrier" when running this command
[PS] C:\Windows\system32>$Folde rPath = Get-MailboxFolderStatistic s -Identity sallenpq -FolderScope Calendar | fl FolderP
ath
[PS] C:\Windows\system32>$Folde rPath
FolderPath : /Calendrier
Thanks !
[PS] C:\Windows\system32>$Folde
ath
[PS] C:\Windows\system32>$Folde
FolderPath : /Calendrier
Thanks !
ASKER
No but i need only the value "Calendrier" not "FolderPath : /Calendrier"
Can you explain what you want to accomplish?
Meanwhile take a look on the following code.
Meanwhile take a look on the following code.
get-mailboxfolderstatistics myusername | where {$_.name -match "Inbox|Deleted|Sent|Calendar|Drafts"} | sort-object Name | ft Name, FolderPath, ItemsInFolder, FolderSize -auto
ASKER
When i run this command
[PS] C:\Windows\system32>$Folde rPath = Get-MailboxFolderStatistic s -Identity sallenpq -FolderScope Calendar | fl FolderPath
and then run this
[PS] C:\Windows\system32>$Folde rPath
i get this value
FolderPath : /Calendrier
I want to trim the value "FolderPath : /Calendrier" to get the value "Calendrier"
Thanks !
[PS] C:\Windows\system32>$Folde
and then run this
[PS] C:\Windows\system32>$Folde
i get this value
FolderPath : /Calendrier
I want to trim the value "FolderPath : /Calendrier" to get the value "Calendrier"
Thanks !
$FolderPathTrim=$FolderPath.Trim("FolderPath : /")
[PS] C:\Windows\system32>$FolderPathTrim
let us know if this do the trick.
regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks that is what i was looking for
Example: folderpath.ps1
Open in new window
Then run it from the powershell line
Hope it helps