Start-Selected by Bernd Kriszio 29 months ago
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/1297"></script>download | new post
Usuallay I use this to start my browser with a URL in some PowerShell Script or retrieved by some Powershell Script. This is an ISE-Extension.
- #Hightlight the name of a file or URL and this will opened or shown in browser
- if ($PSVersionTable.BuildVersion.build -le 7000)
- {
- # PowerShell V2 CTP3
- function Start-Selected
- {
- $ed = $psise.CurrentOpenedFile.Editor
- start $ed.SelectedText
- }
- }
- else
- {
- # PowerShell W7
- function Start-Selected
- {
- $file = $psIse.CurrentPowerShellTab.Output.SelectedText
- if ($file -eq '')
- {
- $file = $psise.CurrentFile.Editor.SelectedText
- }
- if ($file)
- {
- start $file
- }
- }
- }
- #Set-CustomMenu "Start Selected" {Start-Selected} 'Ctrl+Shift+S'
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
PowerShell Code Repository