Preface: I have not been formally trained on how to code. I have kind of winged it and done simple thing like registry entries via powershell.
I have a small script I am trying to run that will test to see how many Virtual Desktops I have running (Get-DesktopCount). I want that return to be tested and if there are 2 or more Virtual Desktops then execute the second part of the statement which is to delete any virtual desktops until there are only two virtual desktops left (Remove-Desktop)
$DTC = Get-DesktopCount
Do
{
Remove-Desktop -Desktop "Desktop 2"
}
Until (($DTC) -gt '2')
I know it has something to do with Syntax and me not being able to distinguish the different types of returns for different cmdlets.