Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Linux .desktop file for PowerShell. Is blue. Also launches admin via right-click. Profile included
[Desktop Entry]
Type=Application
Name=PowerShell
Exec=/home/dev/ps.sh
Icon=/home/dev/powershell.png
Terminal=true
Categories=Utility;
Actions=NewAdminShell;
[Desktop Action NewAdminShell]
Exec=sudo /home/dev/ps.sh
Name=New Admin Shell
# 0. produces something like '[user☭host] [/path/path] ' for the terminal
# 1. new-item -Type file -Path $PROFILE.AllUsersAllHosts
# 2. add the following to the new file (e.g. 'nano $PROFILE.AllUsersAllHosts')
function prompt{
[console]::ForegroundColor = "yellow"
"$('['+[string](whoami)+''+[string](hostname)+'] ['+[string](pwd)+']' * ($nestedPromptLevel + 1)) "
}
#!/bin/bash
#change pwsh to powershell for older versions of PowerShell Core
#image (base64) = iVBORw0KGgoAAAANSUhEUgAAAQ0AAAENCAYAAAAVEjAIAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAACW9GRnMAAAB5AAAAegAj13u7AAAAB3RJTUUH4QYIECIrTBCj2AAAAAl2cEFnAAACAAAAAgAAgcl4TgAAGQVJREFUeNrt3XmcFOWdx/FvVfecDHMwMAcwgAYHERVvBXS9Nia+1HgBniQeeCSal+jqJpvN6hiv9Xi5awziqnggaCIvDzwTl0vQRJfgAUIAuYZjDoa5uufs6qpn/+jpkWOGuar7eZ6q7/svZ+iu+lWLH+vqbgMuKisT5sLmvx4bdcRpwnFKDdMYKxxRACALQJYATDfXR0QxBuAYhggLgSYA1YZhfGca5kYY1ufrHz9rnWEYwsV1DcxZZSK4u2HljwxgBgycJ4TIk/rqEdF+DAN7AeMjwJh3dc7pS8vKDGdAy+vvE08t+zy7vrH9F0JgFoBC2S8MEfWCYew0DTyZlZ353Oqyk1r6tYi+PuGsMhGsaPz0DiGc3wLIlf0aEFF/GDWmgXuvyjnjub7u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ng7x2rDeGNSxkMIg9xrFZYjRUQXbzJzQymR9IG5f/woN8f+ItvHz6t2jDMawDY3y+4IxgWL6sSeU2X4TCDIpCTP3XTsxftPvDxXV532fjk6ctg4rbYAhkMIq/bLxyGKYLZBfdv+5+p73X12EB3C6n728ur80+6JiW0cck/MRhE3iecKITVhtSho18rf/GqO7p7nNHTgoZf+ujqSN2u43vzWCLSl2GYIiWvZFnF23efe6jH9XhbWMXbvzoxbVjpAsMMyP8+OCJKCCMQFOkFR/53T8EA+rD3UHL1nOva92yd61ht8r//lYhcY6Rm2BlFpZfueHXme716fF8WPvzKF0tES9UKK1Q9GsLh4QqRzgxTpGYXbTJyB0/ZPe/22l4/rT/rOvynr1zYUls+P9pUk93fZRCRJIYhUgYPq0vPGXPptvkzVvb56QNZd8n0OTdEmiqfdFobsoUjGA8ilZkBEczIrU8bMvzm8vk3v9nfxbjyH/qIa54faTQ3zLXaQ5PstqYsOFEGhEgBRiBFBNKywoHUrOXIybyhL4ch3S4zEYP+4OqnTrRs4yQnGj1KCLsAtsg0TCNdCEnfUk/kcQbgCCHaDNNsNgLBajNgrLOD2V/sWnD9WrfX9f9Hi1MnIYb9jwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNy0xMC0yMVQxODowMTo1MC0wNzowMCsz13oAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTctMDYtMDhUMTY6MzQ6NDMtMDc6MDDT/Xp8AAAAAElFTkSuQmCC
echo -ne "\033]11;#012456\007"
pwsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment