I think the question has already been asked, despite my various searches, I can't really find the answer.
I get the WSUS groups from a server and I integrate the data in a variable. I would like to delete a specific line in this variable.
For example with a part of the imaginary script :
Write-Output "Delete start"
$Var = ("one", "two", "three", "four")
$Var
$Var_end = $Var.Remove("two")
Write-Output "Delete end"
$Var_end
I want to remove the two value so that the rest of the script can retrieve what's in my variable without retrieving the two or passing on an empty line (as I've already managed to do)
I have tried several functions, in different directions but there is nothing to do I also tried with the function
$Var_end = $Var | select -skip 1
But it's not what I'm looking for because it doesn't look clean as a function, if ever the value changes, I'll have to adapt the script afterwards.
$var_end = @($var) -ne 'two'<- when applied to an array/collection, the comparison operators (like-ne) acts as filters