Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-WindowsFeature -ComputerName ny-web01 |
- ? installed |
- % {$t = ''} { $t += @"
- WindowsFeature "Role-$($_.Name)"
- {
- Name = '$($_.Name)'
- Ensure = 'Present'
- "@
- if ($_.dependson)
- {
- $t += @"
- DependsOn = '[WindowsFeature]Role-$($_.Name)'
- "@
- }
- $t += @'
- }
- '@
- } {$t}
Add Comment
Please, Sign In to add comment