now that Windows 7 is available and the most important event of the year PowerShell v2 Virtual Launch Party is history and James Brundage has buried as under tons of new functions in the PowerShell Pack
hopefully the last installations of PowerShell V2 CTP are replaced by the V2 RTM or V2 RC if you have a downgrade system.
ISE the Integrated Scripting Environment provides Windows conform copy & paste shortcuts. Thanks.
Any case, if you are completely new to PowerShell, it is better if you start with some GUI tool perhaps the free PowerGui or the commercial PowerShell Plus v3.0 , which have a lot of Intellisense build in. If you are interessted inother alternatives I recommend install Shay Levy's PowerShell Toolbar
. The link to the download is a little hidden, just above the comment section. Then go to resources | Script Editors.
These tools are kind of studios. They have some start-up time additional to that caused by your profile scripts and they try to help you in avoiding making mistakes by adding intellisense.
ISE is somewhat other. When you start it for the first time and scan through its menus you get the strong impression that there is something missing. For example: print, recently used files, ....
You are right, but there is something you don't see until you run some suitable script or import a module. ISEPack from the PowerShell Pack is one of these Modules:
import-module isepack
Afterwards the Add-ons menu appears. That is the magic location where you can extend ISE with all kinds of things you can sensibly do. And even some more.
There is an older Code Plex Project PowerShell ISE-Cream
which stagnated the last month due to PowerShell V2 CTP3 - V2 incompatibilities. I hope we will come back to life now.
My advice is please study ISEpack first and try ISE-Cream later. ISE-Cream is open and you too can contribute.
But now let us explore ISEPack a bit.
pushd "$(split-path $profile)\modules\isepack"
Get-ChildItem
The most important file here is IsePack.psm1 . Here you find the code that constructs the add-ons menu.
You have qualms to modify JB's code.
No problem, you leave it as it is and add to the menu in another script:
Add-IseMenu -Name "My Extensions" @{
"Save File AS ANSI" = { $psISE.CurrentFile.Save([Text.Encoding]::default) } |
Add-Member NoteProperty ShortcutKey "ALT+Shift+A" -PassThru
}
Please note that I use default here and not ascii. Ascii is 7-bit only an not suitable for the german and many other western European languages.
Damned I forgot to take my chance at the launch party to ask Jeffrey, why there is a value called default, which isn't used by default.
I hope this helps to take the very first steps into the word of ISE Extensions.
Bernd
I just fixed the code of the 'Save File AS ANSI' example.
AntwortenLöschen