70 lines
1.8 KiB
PowerShell
70 lines
1.8 KiB
PowerShell
# Öffnet die winconfig in VSC
|
|
function edit {
|
|
Set-Location ~/.winconfig/
|
|
code .
|
|
}
|
|
# Speicherplatz anzeigen lassen
|
|
function space {
|
|
Get-CimInstance -ClassName Win32_LogicalDisk | Select-Object -Property DeviceID,@{'Name' = 'FreeSpace (GB)'; Expression= { [int]($_.FreeSpace / 1GB) }}
|
|
}
|
|
# Speichert das Youtube Video als mp3 im aktuellen Ordner
|
|
function ymp3 {
|
|
yt-dlp --extract-audio --audio-format mp3 --format "bestaudio" -ffmpeg-location "C:\Program Files\ffmpeg\ffmpeg.exe"
|
|
}
|
|
|
|
function mp4merge {
|
|
mp4merge.exe
|
|
}
|
|
# Update
|
|
function update {
|
|
Start-Process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Verb RunAs -ArgumentList "-command allupdates | Out-Host" -Wait -WindowStyle Normal
|
|
}
|
|
# Startet das install Script
|
|
Set-Alias -name install -value "~\.winconfig\install.ps1"
|
|
|
|
# Diverses
|
|
${function:cdl} = { Set-Location ~\Downloads }
|
|
Set-Alias trash Clear-RecycleBin
|
|
function touch($file) { "" | Out-File $file -Encoding ASCII }
|
|
|
|
# CD zum Download Ordner
|
|
function cdd {
|
|
Set-Location ~/downloads
|
|
}
|
|
|
|
# Offene Ports anzeigen
|
|
function ports {
|
|
netstat -an | Select-String ABHÖREN
|
|
}
|
|
# PWD replacement
|
|
function pwd {
|
|
Get-Location
|
|
}
|
|
# touch replacement
|
|
function touch {
|
|
New-Item
|
|
}
|
|
|
|
function lotto {
|
|
$numbers50 = @()
|
|
while ($numbers50.Count -lt 5) {
|
|
$randomNumber = Get-Random -Minimum 1 -Maximum 51
|
|
if (-not $numbers50.Contains($randomNumber)) {
|
|
$numbers50 += $randomNumber
|
|
}
|
|
}
|
|
|
|
$numbers12 = @()
|
|
while ($numbers12.Count -lt 2) {
|
|
$randomNumber = Get-Random -Minimum 1 -Maximum 13
|
|
if (-not $numbers12.Contains($randomNumber)) {
|
|
$numbers12 += $randomNumber
|
|
}
|
|
}
|
|
|
|
Write-Host "5 Zahlen von 1-50: $($numbers50 -join ', ')"
|
|
Write-Host "2 Zahlen von 1-12: $($numbers12 -join ', ')"
|
|
}
|
|
|
|
|