Trim In PowerShell: CLI Command Reference, Syntax, Flags
' ') Write-Output $cleaned # Output: ""Alert*** System overload!"" # Note: asterisks inside the string are not removed.
.Trim() only removes characters from start and end
' ') Write-Output $cleaned # Output: ""Alert*** System overload!"" # Note: asterisks inside the string are not removed.
.Trim() only removes characters from start and end