1
+ # display neofetch
2
+ # neofetch
3
+ winfetch
4
+
5
+ # Find out if the current user identity is elevated (has admin rights)
6
+ $identity = [Security.Principal.WindowsIdentity ]::GetCurrent()
7
+ $principal = New-Object Security.Principal.WindowsPrincipal $identity
8
+ $isAdmin = $principal.IsInRole ([Security.Principal.WindowsBuiltInRole ]::Administrator)
9
+
10
+ # this function will launch nodepad
11
+ function n { notepad $args }
12
+
13
+ # This function will prmote the current user to admin
14
+ function prompt
15
+ {
16
+ if ($isAdmin )
17
+ {
18
+ " [" + (Get-Location ) + " ] # "
19
+ }
20
+ else
21
+ {
22
+ " [" + (Get-Location ) + " ] $ "
23
+ }
24
+ }
25
+
26
+ $Host.UI.RawUI.WindowTitle = " PowerShell {0}" -f $PSVersionTable.PSVersion.ToString ()
27
+ if ($isAdmin )
28
+ {
29
+ $Host.UI.RawUI.WindowTitle += " [ADMIN]"
30
+ }
31
+
32
+ # Simple function to start a new elevated process. If arguments are supplied then
33
+ # a single command is started with admin rights; if not then a new admin instance
34
+ # of PowerShell is started.
35
+ function admin
36
+ {
37
+ if ($args.Count -gt 0 )
38
+ {
39
+ $argList = " & '" + $args + " '"
40
+ Start-Process " $psHome \powershell.exe" - Verb runAs - ArgumentList $argList
41
+ }
42
+ else
43
+ {
44
+ Start-Process " $psHome \powershell.exe" - Verb runAs
45
+ }
46
+ }
47
+
48
+
49
+ # Set UNIX-like aliases for the admin command, so sudo <command> will run the command
50
+ # with elevated rights.
51
+ Set-Alias - Name su - Value admin
52
+ Set-Alias - Name sudo - Value admin
53
+ # Set-Alias -Name cat -Value Get-Content
54
+ # Set-Alias -Name touch -Value New-Item
55
+
56
+
57
+ # This function will reload the profile
58
+ function reload-profile {
59
+ & $profile
60
+ }
61
+ # this function will find the file in the current directory
62
+ function find-file ($name ) {
63
+ Get-ChildItem - recurse - filter " *${name} *" - ErrorAction SilentlyContinue | ForEach-Object {
64
+ $place_path = $_.directory
65
+ Write-Output " ${place_path} \${_} "
66
+ }
67
+ }
68
+ # this function will unzip a file in the current directory
69
+ function unzip ($file ) {
70
+ Write-Output (" Extracting" , $file , " to" , $pwd )
71
+ $fullFile = Get-ChildItem - Path $pwd - Filter .\cove.zip | ForEach-Object {$_.FullName }
72
+ Expand-Archive - Path $fullFile - DestinationPath $pwd
73
+ }
74
+ # this function will kill a process instantly.
75
+ function pkill ($name ) {
76
+ Get-Process $name - ErrorAction SilentlyContinue | Stop-Process
77
+ }
78
+
79
+ # starship Promote
80
+ Invoke-Expression (& starship init powershell)
81
+ # this is the terminal icons for dir command
82
+ Import-Module - Name Terminal- Icons
83
+ # Adding the tab collection to the Powershell
84
+ Set-PSReadlineKeyHandler - Key Tab - Function MenuComplete
85
+
86
+
87
+ # Alias for Powershell
88
+ Set-Alias - Name Restart-Computer - Value reboot
89
+ Set-Alias - Name ls - Value dir
90
+ Set-Alias - Name Stop-Computer - Value Shutdown
91
+
92
+ # These are the command that will can give the powershell like fish shell abilities
93
+ Import-Module PSReadLine
94
+ Set-PSReadLineOption - PredictionSource History
95
+
96
+
97
+ # Programs used:
98
+ # All of these Application can be installed using Sccop
99
+ # learn about scoop here: https://scoop.sh/
100
+ # Sccop
101
+ # winfetch or Neofetch
102
+ # terminal-icons
103
+ # lsd
104
+ # starship
0 commit comments