powershell - Determine Win32_OptionalFeature's Parent feature -
back story, in 2012-r2, powershell v4.0 have access get-windowsfeature
cmdlet, works on server os. includes parent field needed populate treeview node, kid nodes keyed parent node.
get-windowsfeature | select name,displayname,installed,parent
from windows 7/8.1, cannot utilize cmdlet, doesn't run on desktop os. can see same info here, no parent id field. how can determine parent feature wmi ? open reply solves problem.
gwmi win32_optionalfeature | select name,caption,installstate
http://msdn.microsoft.com/en-us/library/ee309383%28v=vs.85%29.aspx
in short, trying generate .csv dump gwmi command used populate treeview command based on installed features. kinda this.
not asking, microsoft provide dism utility manage optional features. have @ /get-features
, /get-featureinfo
switch.
here illustration on how install rsat (remote server adminitration tools)
start-process "powershell" -verb "runas" -argumentlist "-noprofile -command dism.exe /online /enable-feature /featurename:remoteserveradministrationtools /featurename:remoteserveradministrationtools-roles /featurename:remoteserveradministrationtools-roles-ad /featurename:remoteserveradministrationtools-roles-ad-powershell"
powershell treeview powershell-v4.0 powershell-v5.0
No comments:
Post a Comment