PowerShell - System Administration
You want to write a script that installs multiple Windows features: 'Web-Server', 'Telnet-Client', and 'RSAT'. Which is the best PowerShell approach?
Install-WindowsFeature accepts multiple feature names as a comma-separated list in the -Name parameter, but it is recommended to use a loop for clarity and error handling.Install-WindowsFeature for each feature name in an array is the best approach for scripting multiple installs. Running once with all names separated by commas is possible but less flexible. Piping Get-WindowsFeature output would attempt to install all features, which is dangerous. Using Uninstall-WindowsFeature first is inefficient and risky.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions