Change comparaison operator fot powershell Major Version (remove_tasks)
This commit is contained in:
parent
bea2b01cfb
commit
0d22769974
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ function remove_tasks () {
|
||||||
param($taskList)
|
param($taskList)
|
||||||
Foreach ($task in $taskList){
|
Foreach ($task in $taskList){
|
||||||
Write-Host -ForegroundColor white -NoNewline "Remove Task " $task.name
|
Write-Host -ForegroundColor white -NoNewline "Remove Task " $task.name
|
||||||
if ($PSVersionTable.PSVersion.Major > 2) {
|
if ($PSVersionTable.PSVersion.Major -gt 2) {
|
||||||
if (Get-ScheduledTask -TaskName $task.name -ErrorAction SilentlyContinue) {
|
if (Get-ScheduledTask -TaskName $task.name -ErrorAction SilentlyContinue) {
|
||||||
Write-Host -NoNewline -ForegroundColor DarkGreen " found! "
|
Write-Host -NoNewline -ForegroundColor DarkGreen " found! "
|
||||||
Write-Host -Nonewline -ForegroundColor white "removing ... "
|
Write-Host -Nonewline -ForegroundColor white "removing ... "
|
||||||
|
|
Reference in a new issue