PowerShell/profile.ps1
2023-06-17 15:29:09 -06:00

28 lines
822 B
PowerShell

# Scripts in this $PROFILE folder are added to the PATH
$env:path += ";$(Split-Path -Parent $MyInvocation.MyCommand.Path)"
function Test-Admin {
$current_user = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
$current_user.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}
function prompt {
$prompt = "> "
If (Test-Admin -eq $true) {
$prompt = "Admin$prompt"
}
$prompt
}
function Install-Scoop {
# You can read the script before executing it here:
# https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1
Invoke-RestMethod get.scoop.sh | Invoke-Expression
# (un)install docs: https://github.com/ScoopInstaller/Install
}
function Install-BleachBit {
scoop bucket add extras
scoop install bleachbit
}