I want to write a PowerShell Script that displays all exclusions set in Windows Defender in Windows 10. So I already found out that this can be done by calling
Get-MpPreference | Select-Object -Property ExclusionPath
Which truncates the output if there are a lot of files and folders defined.
So I tried to add
Get-MpPreference | Select-Object -Property ExclusionPath | Out-String -width 1024
Which leads to a similar output: the string gets longer, but the truncation persists, only some whitespace is added to the end:
ExclusionPath
-------------
{C:\Users\Elvi\Documents\Assassin's Creed IV Black Flag, C:\Users\Elvi\Documents\Benutzerdefinierte Office-Vorlagen, C:\Users\Elvi\Documents\FHOA, C:\Users\Elvi\Documents\Gebuhrenzentrale...}
PS C:\WINDOWS\system32>
So how can I prevent Powershell from truncating the output of the folders?
Get-MpPreference | Select-Object -expand ExclusionPath