DougFinke

Printers & PowerShell

Sep 25th, 2011
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Import-Module ShowUI
  2.  
  3. New-Window -WindowStartupLocation CenterScreen -Width 400 -Height 400 -Show {
  4.     StackPanel {
  5.        
  6.         TextBlock -Margin 5 `
  7.             "Select a Printer to replace $((Get-WmiObject -Class Win32_Printer | Where-Object  {$_.Default}).Name) as the default"
  8.  
  9.         ComboBox  -Margin 5 `
  10.             -IsSynchronizedWithCurrentItem $true `
  11.             -DataContext (Get-WmiObject -Class Win32_Printer) `
  12.             -DataBinding @{ItemsSource = "." } `
  13.             -DisplayMemberPath Name
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment