PowerShell - NoNewLine Write-Host parameter in SPLATTING

202 Views Asked by At

(If there is something wrong with my english, i apologize in advance) Hi, I don't know much about splatting, I have used it only 2 or 3 times, but this time I have to use it with Write-Host. I would like to add the NoNewLine parameter to the splatting, like this:

$splatting = @{ForegroundColor="Magenta"; BackgroundColor="Black"; NoNewLine}

But the console don't let me execute it, so I tried to set it as $true, but I get the error: Cannot convert 'System.String' to the type 'System.Management.Automation.SwitchParameter'. How can i do?

0

There are 0 best solutions below