Skip to content
Get-History
PowerShell Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
1337x.to.ps1
Update-ShellPrompt.ps1
discord_request_1.ps1
discord_request_2.md
flac.xyz.ps1
install-powershell-on-alpine.sh
msdn_shitter.ps1
neofetch.ps1
readme.md

readme.md

Get-History

Okay, maybe something is for linux as well

rename all files to guids

gci -File | % { Rename-Item -Path $_.Name -NewName (((New-Guid).Guid)+($_.Extension)) }

install go on alpine

export GOLANG_VERSION="1.13.7" ; set -eux; apk add --no-cache --virtual .build-deps bash gcc musl-dev openssl go ; export GOROOT_BOOTSTRAP="$(go env GOROOT)" GOOS="$(go env GOOS)" GOARCH="$(go env GOARCH)" GOHOSTOS="$(go env GOHOSTOS)" GOHOSTARCH="$(go env GOHOSTARCH)" ; wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; echo 'e4ad42cc5f5c19521fbbbde3680995f2546110b5c6aa2b48c3754ff7af9b41f4 *go.tgz' | sha256sum -c -; tar -C /usr/local -xzf go.tgz; rm go.tgz;cd /usr/local/go/src;./make.bash;rm -rf /usr/local/go/pkg/bootstrap /usr/local/go/pkg/obj ; apk del .build-deps ; export PATH="/usr/local/go/bin:$PATH"; go version

imagemagick remove border

gci -recurse | % { & 'C:\Program Files\ImageMagick-7.0.9-Q16\convert.exe' $_.name -trim +repage $_.name }

epoch to datetime

(Get-Date 01.01.1970)+([System.TimeSpan]::fromseconds(1550293345))

Rip userbars

1..60000 | ForEach-Object -Process { wget -w 5 --content-disposition --no-check-certificate "https://www.userbars.be/download/$_" }
function LL { param ($dir = ".")
  $origFg = $host.ui.rawui.foregroundColor
  foreach ($Item in (Get-ChildItem $dir))
  {
    Switch ($Item.Extension)
    {
      ".Exe" {$host.ui.rawui.foregroundColor = "Yellow"}
      ".cmd" {$host.ui.rawui.foregroundColor = "Green"}
      ".msh" {$host.ui.rawui.foregroundColor = "Red"}
      ".vbs" {$host.ui.rawui.foregroundColor = "Red"}
      Default {$host.ui.rawui.foregroundColor = $origFg}
    }
    if ($item.Mode.StartsWith("d")) {$host.ui.rawui.foregroundColor = "Blue"}
    $item
  }
  $host.ui.rawui.foregroundColor = $origFg
}

YT-DL

youtube-dl --verbose --ignore-errors --no-continue --no-overwrites --no-post-overwrites --download-archive archive_batch.txt --write-description --write-info-json --write-annotations --write-thumbnail --all-subs --output "batch_videos/%(uploader)s/%(upload_date)s - %(title)s/%(title)s.%(ext)s" -f "bestvideo[ext=webm]+bestaudio[ext=webm]/bestvideo[ext=webm]+bestaudio/bestvideo+bestaudio[ext=webm]/bestvideo+bestaudio/best" --merge-output-format webm https://www.youtube.com/watch?v=

Something stolen from somewhere around Microsoft Terminal github

\e]11;rgb:ff/ff/ff\e\\

For this pesky software that grinds CPU/RAM/Storage

Stop-Service -Name '<service>' -Force; Stop-Process -Name '<process>.exe'; Set-Service -Name '<service>' -StartupType Disabled

appwiz.cpl in powershell

Get-CimInstance win32reg_addremoveprograms

OS Name

(Get-WmiObject -class Win32_OperatingSystem).Caption

Users assigned per desktop | Citrix/PowerShell

Get-BrokerMachine -SessionSupport SingleSession -AdminAddress $(Get-DeliveryController) -MaxRecordCount 1000 | Where-Object {$_.DesktopGroupName -like "**"} | Select MachineName, @{n='Usernames';e={$_.AssociatedUserNames -join ';' }}

Garbage Collector

[System.GC]::Collect()

Ternary

$index = @{$true=1;$false=2}[$a -eq 'a']

debian profile

# ANSI color codes
RS="\[\033[0m\]"    # reset
HC="\[\033[1m\]"    # hicolor
UL="\[\033[4m\]"    # underline
INV="\[\033[7m\]"   # inverse background and foreground
FBLK="\[\033[30m\]" # foreground black
FRED="\[\033[31m\]" # foreground red
FGRN="\[\033[32m\]" # foreground green
FYEL="\[\033[33m\]" # foreground yellow
FBLE="\[\033[34m\]" # foreground blue
FMAG="\[\033[35m\]" # foreground magenta
FCYN="\[\033[36m\]" # foreground cyan
FWHT="\[\033[37m\]" # foreground white
BBLK="\[\033[40m\]" # background black
BRED="\[\033[41m\]" # background red
BGRN="\[\033[42m\]" # background green
BYEL="\[\033[43m\]" # background yellow
BBLE="\[\033[44m\]" # background blue
BMAG="\[\033[45m\]" # background magenta
BCYN="\[\033[46m\]" # background cyan
BWHT="\[\033[47m\]" # background white

if [ "$color_prompt" = yes ]; then
    PS1='\[\033[1m\]${debian_chroot:+($debian_chroot)}[\[\033[0m\] \[\033[31m\]\u is the best \[\033[33m\]\@ \[\033[35m\]\h\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$] '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

alias ls='ls -la --color=auto'

getting file hashes -recurse

Get-ChildItem -Recurse | ForEach-Object -Process { Get-FileHash -Path $_.FullName -Algorithm SHA1 | Export-Csv X:\hashes.sha1 -Encoding utf8 -Append -Delimiter ';' -NoTypeInformation }

change title in Windows Terminal

[System.Console]::Title = '<text>'
You can’t perform that action at this time.