powershell v2.0 - Excessive whitespace around filepath -
ps c:\> $pst_path = $outlook.session.stores | { ($_.filepath -like '*.pst') } | select filepath | format-table -hide ps c:\> $pst_path c:\users\abelej\documents\outlook files\my outlook data file(1).pst ps c:\> _
i've tried using $pst_path.trim()
method trim leading , trailing spaces no luck. can see above white space variable contains. problem comes when i'm using copy-item
complains file name exceeds 260 character limit.
the format-*
cmdlets displaying formatted data user. not use them if need further process data. expand filepath
property instead:
$outlook.session.stores | { $_.filepath -like '*.pst' } | select -expand filepath
Comments
Post a Comment