$MowMsh = $args[0]
# Set Prompt
function prompt { $Dir = get-location; $host.ui.rawui.windowtitle = "/\/\o\/\/SH - $dir";Write-Host -nonewline -ForeGroundColor Red MSH;">" }
# Extra Drives
& {
get-drive | forEach {$str = "function global:$($_.name): { set-location $($_.name): } ";invoke-command $str}
Function global:var: {set-Location variable:}
Function global:fun: {set-Location function:}
}
# Load .NET Classes
[void][System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms")
# Load Custom .NET Class Libraries
[void][System.Reflection.Assembly]::LoadFile("$MowMsh\Lib\MowClipBoard.dll")
# Load Custom TypeData
update-typeData "$mowmsh\TypeData\mowtypes.mshxml"
# Custom Aliases
set-alias new new-object
# ShortCut Functions (Internal)
Function cd.. {cd ..}
Function Start. {(new-object -com shell.application).Explore((pwd).tostring())}
function in-host {[system.console]::in.readtoend()}
function CopyCon{
if ($args[0] -eq $null) {[system.console]::in.readtoend() | out-file}
Else {[system.console]::in.readtoend() | out-file $args[0]}
}
# shorcut Fuctions (External)
function gwc {. $MowMsh\functions\Get-WmiClasses.msh}
# Critical Functions (External)
. $MowMsh\functions\View-Object.msh
. $MowMsh\functions\Get-WmiHelp.msh
. $MowMsh\functions\Get-WmiMethodHelp.msh
. $MowMsh\functions\More.msh
# Not Critical Functions
. $MowMsh\functions\Wipe-Screen.msh
. $MowMsh\functions\Throw-Dices.msh
The .Net libraries I want standard loaded
(here is the form that started this, only hidden in the OV before)
Custom DLL’s,
custom .NET libraries, this are not the CMDlets !!, as they are compiled in the custom shell (also topic for a later blog I think, the beta doc’s (see $links-section on bottom of page) also have good info on this), but this are “Normal” .NET classes I want to load, for an example see :
MSH Clipboard part 2 (of 3 ?)
Custom Typedata :
Another very strong way to tune your MSH environment !!
Update-TypeData (Democracy to the types)
Custom aliases
I don’t have much at the moment (as I would forget and post scripts with them ;-) ), but I do make a lot “on-the-fly” when working on something.
Some shortcut functions I like
CopyCon : adopted on Reskit http://www.reskit.net/monad/samplescripts.htm
The rest is self explainatory I think
Some shortcut functions to scripts I start often , as getWmiClasses.MSH.
" Wmi-Help Part 1 " Getting All the WMI Classes and Descriptions in a HashTable
But that I don’t want to load for 1 second every time I start the shell, so I don’t load the actual script Here, but I only make I shortcut GWC that call’s the script (I changed the script a bit for this, I loaded it in a new scope and made the variable global, JS advised against it, but in this case the whole point of the script is to put it Global so I did it anyway ;-) ), the script: scope is normaly better for this.
& {
$global:wmiClasses
}
Some bigger scripts I consider critical .
MSH Object Viewer : by far my most used function,
as replacement to GM,
to configure .NET objects ,
to browse WMI. (I renamed it to the view-object to be more consisted with MSH naming , but I still use it as object e.g OV(gi .) also.
" WMI help Part 2 ",Getting Help on WMI classes, ( get-WmiHelp (GWH) Function)"
WMI help Part 3 (Methods) ", Getting Help on Methods and generating Sample Scripts.
(Updated version)
To view al instances of a WMI class
WMI viewer script for MSH (GUI)
And the not critical functions I still want to keep handy,
Wipe the screen in MSH (just want to do it like this some times, mostly I need a smoke then ;-) , that’s why I can’t wait for the burn version ;-)
Thow Dices in MSH (for example to answer who gets coffee ?)
I did leave out a handful of functions I would not think you care about, also I still have a lot of usefull scripts that I just load when Needed, or still need to add as it's a bit older profile.
This blogentry got a lot bigger as I planned but I think this gave a good example if the different way’s to tune monad.
- profile
- typedata
- cmdlets
- providers
and focusing on the Profile, the different way’s to load or just alias items within a Profile.
I hope this info helps you tuning your MSH environment to your own wishes.
Gr /\/\o\/\/
October 2005 November 2005 December 2005 January 2006 February 2006 March 2006 April 2006 May 2006 June 2006 July 2006 August 2006 September 2006 October 2006 November 2006 December 2006