Someone can tell me if is possible pass variables when i call Remove-Printer command on Powershell?
Remove-Printer -Name 'Printer1 (Copy $i)'
Idk if this is possible but i tried this:
for ($i=0; $i -le 5; $i ++) {
Remove-Printer -Name 'Printer1 (Copy '+$i+')'
}
and more unsuccessful attempts...
If someone can help me... thanks you.
+to concatenate strings; probably'Printer1 (Copy $i)'will work. Check this: For-Loop