christitustech / powershell-profile Goto Github PK
View Code? Open in Web Editor NEWPretty PowerShell that looks good and functions almost as good as Linux terminal
Pretty PowerShell that looks good and functions almost as good as Linux terminal
Running Windows 10, PowerShell 7.2.7 with or without "Run as Administrator" and in a writable directory (c:\Users\Username\Downloads)
When running the install command "irm "https://github.com/ChrisTitusTech/powershell-profile/blob/main/setup.ps1" | iex"
Output: "The '<' operator is reserved for future use."
Exits without doing anything
Tried in older Powershell 5.1.x and gets tons of errors, but similar to the above error message.
Dear Mr. Titus,
When you updated your powershell-profile I lost my personal-profile.
If you think is interesting, Can you put at end to load personal.ps1 if it exists?
Great job.
Thanks
Exception: Line | 23 | throw $_.Exception.Message | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | Parameter cannot be processed because the parameter name 'o' is ambiguous. Possible matches include: -OperationTimeoutSeconds -OutFile -OutVariable -OutBuffer.
anyone a solution to that?
Trying out your bin.christitus. Works great. Only thing I am wondering if it is possible to curl -X DELETE <url>
. Would be save you space. When I do it, it gives me an error.
when i try to install this, i am getting web request errors
Web request status [Web request completed. (Number of bytes processed: 8328)
Web request status [Web request completed. (Number of bytes processed: 8328)
Web request status [Web request completed. (Number of bytes processed: 8328)
Web request status [Web request completed. (Number of bytes processed: 8328)
Web request status [Web request completed. (Number of bytes processed: 8328)
and lots of more
function uptime {
$bootuptime = (Get-CimInstance -ClassName Win32_OperatingSystem).LastBootUpTime
$CurrentDate = Get-Date
$uptime = $CurrentDate - $bootuptime
#Windows Powershell only
net statistics workstation | Select-String "since" | foreach-object {$_.ToString().Replace('Statistics since ', 'Last Reboot: ')}
Write-Output "Uptime: Days: $($uptime.days), Hours: $($uptime.Hours), Minutes:$($uptime.Minutes), Seconds:$($uptime.Seconds)"
Remove-Variable bootuptime
Remove-Variable CurrentDate
Remove-Variable uptime
}
preview of how that looks in powershell, works in both 5 and 7
Nice idea but with this loading time this profile is unusable.
When I run the setup command elevated permission on your website the command just keeps showing wget and downloads random bits and never stops.
Cheers and thanks for your great work
Hi Titus, I've tried to add Terminal icons to your script on my fork.
On setup.ps1, I added the line at the end
Install-Module -Name Terminal-Icons -Repository PSGallery
On Microsoft.PowerShell_profile.ps1, I added
Import-Module -Name Terminal-Icons
at the beggining, line 16.
I just want to ask if this is all I have to do to get those icons, I'm not used to code for powershell so I thought I'd be better to ask if it's just this that needs to be done in order for it to work.
Thanks!
After installation, launching a new instance of PowerShell results in an immediate error of the Microsoft.Powershell_profile.ps1 file being unable to be loaded due to it not being digitally signed.
`. : File C:\Users\Sora\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded. The file
C:\Users\Sora\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 is not digitally signed. You cannot run
this script on the current system. For more information about running scripts and setting execution policy, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess`
Now tis can be resolved by self signing the profile, but this just results in another dependency complaining about not being signed.
My assumption is this is not the intended solution then given it is not described in the readme, which seems to imply just running the command irm "https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1" | iex
will have everything running smoothly.
Haven't seen any other issues in regards to signing issues so a little at a loss here.
Install was done from an elevated PowerShell instance and run in my user home folder (C:\Users\Sora)
I watched your video and I never knew what I was missing, really cool.
I tried to install it on PS 5.1 and I am getting the below error:
Cannot bind parameter 'NewerThan'. Cannot convert value "True" to type "System.DateTime". Error: "The string was not recognized as a valid DateTime. There is an unknown word starting at
index 0."
Not sure if anyone else is getting this.
I get this error when I try to install your script I think its a script.
iex : At line:198 char:17
Sign up
~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At line:203 char:209
~
The '<' operator is reserved for future use.
At line:412 char:13
CI/CD & Automation
~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At line:1684 char:126
~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At line:1684 char:148
~~~~
Unexpected token 'Jump' in expression or statement.
At line:1726 char:153
~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At line:1726 char:160
~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At line:1726 char:172
~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At line:1726 char:179
~
Missing expression after unary operator ','.
At line:1726 char:179
~
Unexpected token '&' in expression or statement.
Not all parse errors were reported. Correct the reported errors and try again.
At line:1 char:82
~~~
Import-Module : The specified module 'Terminal-Icons' was not loaded because no valid module file was found in any
module directory.
At C:\Users\lukas\OneDrive\Dokumenty\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:35 char:1
+ CategoryInfo : ResourceUnavailable: (Terminal-Icons:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
PS C:\Windows\system32> ^C
PS C:\Windows\system32> (Get-Host).Version
Major Minor Build Revision
5 1 19041 3930
After installation, first there was no cove.zip in the directory I executed the command from.
Now whenever I launch a new Powershell window I get the following error:
Test-Connection : A parameter cannot be found that matches parameter name 'TimeoutSeconds'.
At C:\Users\xlt\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:5 char:66
~~~~~~~~~~~~~~~
Skipping profile update check due to GitHub.com not responding within 1 second.
Skipping PowerShell update check due to GitHub.com not responding within 1 second.
oh-my-posh : The term 'oh-my-posh' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At C:\Users\xlt\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:260 char:1
+ CategoryInfo : ObjectNotFound: (oh-my-posh:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Loading personal and system profiles took 1109ms.
Hi, I have feature request regarding the Oh-My-Posh config.
It'd be nice to have a environment variable to change the OMP config so that it's easy to change it's config file as the script goes back to the default theme after checking the hash at startup.
P.S. I have been watching your channel since 2022 and I just wanna say thank you for your scripts and tools.
Is PR welcome if I change the ls alias to use eza ?
It's certainly more beautiful than Windows' directory listing, and looks similar to what we have in Linux.
how i change oh my posh theme?
i tried go to powershell profile created in #documents folder and change the line oh-my-posh --init --shell pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression but it doesn't work
i tried tokyo and dracula themes, without sucess
Is there a way to reverse these changes?
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
Test-Connection : A parameter cannot be found that matches parameter name 'TimeoutSeconds'.
At C:\Users\Brian Haines\WLE Dropbox\Brian Haines\PC
(2)\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:5 char:66
~~~~~~~~~~~~~~~
Skipping profile update check due to GitHub.com not responding within 1 second.
Skipping PowerShell update check due to GitHub.com not responding within 1 second.
Loading personal and system profiles took 2185ms.****
Powershell: version 5
This is the printed error:
Test-Connection : A parameter cannot be found that matches parameter name 'TimeoutSeconds'.
At C:\Users\HP\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:5 char:66
~~~~~~~~~~~~~~~
Hi Titus,
Why does this script need choco to be installed in order to work ?
Hi, Chris! First of all congrats on the awesome work you do! Found your YT channel about 3 or 4 years ago and I don't miss it.
I absolutely don't know how to create a pull request so I'm using this space to suggest a change in the setup script regarding the download of cascadia font because it should now point to "https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.0/CascadiaCode.zip".
Also, I'd like to ask if you know what could be happening with the cobalt2 theme. When I first watched the installation process on YT right after you released it, I installed it and it worked fine, with the beautiful prompt that is always present in your videos. A couple of months ago I had to reinstall my PC and ever since all I get is this:
I tried it on 2 different PCs and 1 VM with a clean Windows install and the result is the same. All the other OMP themes work just fine.
Thanks for your attention.
P.S.: by the way, today I was messing around with the installation process (again) and I noticed that the profile was taking too long to load. I removed the new update section and it worked just fine again.
I uninstalled Oh My Posh completely and re-installed but couldn't get back to default settings of oh-my-posh and change the theme according to the guides. Some help for a noob?
Here's the whole error message I am getting.
Test-Connection : A parameter cannot be found that matches parameter name 'TimeoutSeconds'.
At E:\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:5 char:66
~~~~~~~~~~~~~~~
Import-Module : The specified module 'Terminal-Icons' was not loaded because no valid module file was found in any module directory.
At C:\Users\pakosaan\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:17 char:1
Any chance to get a MIT licence applied to this repo?
I ran the script as it's mentioned in the document section and it is supposed to download the cove.zip file but unfortunately, it doesn't download the file. seem something is broken and need to be fixed. meanwhile, may I get the cove.zip file to get the nerd font
So PowerShell got updated from 7.4.2 to 7.4.3 and this message appears:
PowerShell has been updated. Please restart your shell to reflect changes
but how ? reboot doesn't work.
PowerShell 7.3.7
zoxide: C:\Users\danzg\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:219
Line |
219 | Invoke-Expression (& { (zoxide init powershell | Out-String) })
| ~~~~~~
| The term 'zoxide' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.
Invoke-Expression: C:\Users\danzg\Documents\PowerShell\Microsoft.PowerShell_profile.ps1:219
Line |
219 | Invoke-Expression (& { (zoxide init powershell | Out-String) })
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot bind argument to parameter 'Command' because it is null.
In an attempt in using your utility to install FanControl I am presented with it supposedly being installed but no files are present on the computer to run the program afterwards. When attempting to then uninstall the program with your utility it is presented with an error. This is the print in powershell for both of those.
Version: v1.7.11261
- Winget is a release version.
- Winget is Up to Date
Version: v1.7.11261
- Winget is a release version.
- Winget is Up to Date
How about setting up fastfetch to run automatically on startup? It won't add any new functionality, but it'll definitely give your system a cool touch.
As instructed Elevated PowerShell pasting the One Line Install line this error is popping up every time. -
Cannot bind parameter 'NewerThan'. Cannot convert value "True" to type "System.DateTime". Error: "The string
was not recognized as a valid DateTime. There is an unknown word starting at index 0."
At line:19 char:10
throw $_.Exception.Message
~~~~~~~~~~~~~~~~~~~~~~~~~~
edit-profile wants to create profile.ps1 rather than edit microsoft.powershell_profile.ps1
You mention in the notes that a zip file with fonts will be installed in the installation folder after setup?
Nothing in my folder after setting up? Is there another location that this is created?
Bitdefender says "PowerShell tried to load a malicious resource detected as Heur.BZC.ZFV.Boxter.341.15F94BE2 and was blocked. Your device is safe.:
notepad needs to be at bottom else if its in the middle since we all have notepad it will just get stuck there and set $EDITOR to notepad and it wont check the once below (i had that issue with original code when notepad was above sublime text.
# Aliases
#
# If your favorite editor is not here, add an elseif and ensure that the directory it is installed in exists in your $env:Path
#
if (Test-CommandExists nvim) {
$EDITOR='nvim'
} elseif (Test-CommandExists pvim) {
$EDITOR='pvim'
} elseif (Test-CommandExists vim) {
$EDITOR='vim'
} elseif (Test-CommandExists vi) {
$EDITOR='vi'
} elseif (Test-CommandExists code) {
$EDITOR='code'
} elseif (Test-CommandExists notepad++) {
$EDITOR='notepad++'
} elseif (Test-CommandExists sublime_text) {
$EDITOR='sublime_text'
} elseif (Test-CommandExists notepad) {
$EDITOR='notepad'
}
If I change the profile, the changes stay, however, only until a restart.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.