PowerShell3.0
 まずは簡単そうなコマンドから。
Show-ControlPaneItemはその名前通りコントロールパネルを開くコマンド。  
   | Show-ControlPanelItem "Power Options" | 
 てな感じで「電源管理」のコントロールパネルが開く。

 これだけではあまり面白くないが、このコマンドと共にGet-ControlPaneItemなるものも追加されている。
こちらは強力そう。
さしあたってこんな感じで「電源管理」が開く。  
   | Get-ControlPanelItem "power options" | Show-ControlPanelItem | 
 一覧表示するにはこんな感じ。  
   | PS>Get-ControlPanelItem -Name * | group category | sort name Count Name                      Group----- ----                      -----
 14 {All Control Panel Items} {Color Management, Device Manager, G
 1 {Appearance and Person... {Display}
 1 {Appearance and Person... {Desktop Gadgets}
 4 {Appearance and Person... {Folder Options, Fonts, Personalizat
 2 {Clock, Language, and ... {Date and Time, Region and Language}
 1 {Ease of Access, Appea... {Ease of Access Center}
 1 {Ease of Access}          {Speech Recognition}
 1 {Hardware and Sound, S... {Power Options}
 4 {Hardware and Sound}      {AutoPlay, Devices and Printers, Loc
 3 {Network and Internet}    {HomeGroup, Internet Options, Networ
 2 {Programs}                {Default Programs, Programs and Feat
 7 {System and Security}     {Action Center, Administrative Tools
 4 {User Accounts and Fam... {Windows CardSpace, Credential Manag
 | 
 っで、こいつでコントロールパネルアイテムのオブジェクトを取得すれば設定は自由自在、かと思ったが今のところそうではなさそう。  
   | PS>Get-ControlPanelItem "Power Options" | gm TypeName: Microsoft.PowerShell.Commands.ControlPanelItem
 Name          MemberType Definition----          ---------- ----------
 Equals        Method     bool Equals(System.Object obj)
 GetHashCode   Method     int GetHashCode()
 GetType       Method     type GetType()
 ToString      Method     string ToString()
 CanonicalName Property   System.String CanonicalName {get;}
 Category      Property   System.String[] Category {get;}
 Description   Property   System.String Description {get;}
 Name          Property   System.String Name {get;}
 
 | 
 今後に期待。
  
 
0 件のコメント:
コメントを投稿