Powershell profile

Povray

Public Domain

Various helper functions

Download (right click, save as, rename as appropriate)

Embed

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function up($numLevels = 1)
{
    for ($i = 0; $i -lt $numLevels; $i++)
    {
        cd ..
    }
}

function Get-BatchFile ($file)
{
    $cmd = "`"$file`" & set"
    cmd /c $cmd | Foreach-Object {
        $p, $v = $_.split('=')
        Set-Item -path env:$p -value $v
    }
}

function VsVars32()
{
    $vs90comntools = (Get-ChildItem env:VS90COMNTOOLS).Value
    $batchFile = [System.IO.Path]::Combine($vs90comntools, "vsvars32.bat")
    Get-BatchFile $batchFile
 
    [System.Console]::Title = "VS2008 Powershell"
}