Hi Guys
Hope you can help! I am not great with PowerShell just yet, getting to grips slowly but am stuck on something simple, even after some searching.
So I have a script something like this;
$taskcheck = schtasks /tn "Scheduled Task"
IF($taskcheck)
{
Write-Host "Already Exists!"
}
Else
{
Write-Host "Doesn't Exist, Creating"
}
So if the task name does exist, it works great. However, when the task doesn't exist, it throws this messy looking error in red font - how can I hide this and just show my message "Doesn't Exist, Creating"