An Azure service for ingesting, preparing, and transforming data at scale.
First, the quoting in the string is incorrect. Replace the 1st and last double-quote with a single-quote.
Can you explain (or show) what you expect to see as a result of running that code?
You can do without the need for an intermediate array:
$t = 'Server - shutdown in 2014, 2018 "Systems" database The server is expected to be kept until July 30th, 2023, and'
if ($t -Match ','){
$annotation = $t.replace('"',' ').Replace(',','')
Write-Output $Annotation
Write-Output "clear"
}
The result of running your code (or the code above) is:
Server - shutdown in 2014 2018 Systems database The server is expected to be kept until July 30th 2023 and
clear