Advertisement
easternnl

Set-ForegroundWindow - Brings a Window to the front

Aug 7th, 2015
610
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Bring a specific application to the foreground
  2. #
  3. # usage: Set-ForegroundWindow -ApplicationName "Internet Explorer"
  4. Function Set-ForegroundWindow
  5. {
  6.     param ( [Parameter(Mandatory =$true, ValueFromPipelineByPropertyName=$true ,HelpMessage= "Name of the transaction", ValueFromPipeline=$true )]    [string]$applicationname)
  7.  
  8.     add-type -AssemblyName microsoft.VisualBasic
  9.     [Microsoft.VisualBasic.Interaction]::AppActivate($applicationname)
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement