-
Notifications
You must be signed in to change notification settings - Fork 0
/
utils.psm1
39 lines (29 loc) · 868 Bytes
/
utils.psm1
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$myhome = 'C:\home\'
function Get-Info
{
param($ComputerName)
Get-WmiObject -ComputerName $ComputerName -Class Win32_BIOS
}
Function cguid { [Guid]::NewGuid().guid | Set-Clipboard }
Function cwd { $PWD.Path | Set-Clipboard }
Function mkdir {
param([string]$path)
if (-not $path) { return }
New-Item -Path $path -ItemType Directory -EA SilentlyContinue | Out-Null
if (Test-Path -Path $path) { Set-Location -Path $path }
}
Function ewd {
param([string] $path = $PWD.Path)
if ($path.EndsWith("\")) {
$path = $path.Substring(0, $path.Length - 1)
}
explorer $path
}
function touch {set-content -Path ($args[0]) -Value ($null)}
function repo {
$location = Join-Path $myhome 'repo'
Set-Location $location
}
function ~ {
Set-Location $myhome
}