Giter Site home page Giter Site logo

powershell-profile's Introduction

🎨 PowerShell Profile (Pretty PowerShell)

A stylish and functional PowerShell profile that looks and feels almost as good as a Linux terminal.

⚡ One Line Install (Elevated PowerShell Recommended)

Execute the following command in an elevated PowerShell window to install the PowerShell profile:

irm "https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1" | iex

🛠️ Fix the Missing Font

After running the script, you'll find a downloaded cove.zip file in the folder you executed the script from. Follow these steps to install the required nerd fonts:

  1. Extract the cove.zip file.
  2. Locate and install the nerd fonts.

Now, enjoy your enhanced and stylish PowerShell experience! 🚀

powershell-profile's People

Contributors

aayush-rajagopalan avatar christitustech avatar codeclimbernt avatar itoleck avatar rehanplayz avatar revenge977 avatar sahil-jindal avatar scottmckendry avatar solomoncyj avatar theycallmez avatar xraverx avatar zanzythebar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powershell-profile's Issues

Choco ?

Hi Titus,

Why does this script need choco to be installed in order to work ?

Error when I install

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

  • ... k Button--medium Button d-lg-none color-fg-inherit p-1"> <span cla ...
  •                                                             ~
    

The '<' operator is reserved for future use.
At line:412 char:13

  •   CI/CD &amp; 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

  • ... js-jump-to-line-field" type="text" placeholder="Jump to line…" ...
  •                                                             ~
    

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

  • ... pe="text" placeholder="Jump to line…" aria-label="Jump to line ...
  •                                                          ~~~~
    

Unexpected token 'Jump' in expression or statement.
At line:1726 char:153

  • ... thub-terms-of-service" data-analytics-event="{"category":&q ...
  •                                                             ~
    

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

  • ... rms-of-service" data-analytics-event="{"category":"Foo ...
  •                                                             ~
    

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

  • ... ce" data-analytics-event="{"category":"Footer",&q ...
  •                                                             ~
    

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

  • ... ta-analytics-event="{"category":"Footer","ac ...
  •                                                              ~
    

Missing expression after unary operator ','.
At line:1726 char:179

  • ... a-analytics-event="{"category":"Footer","act ...
  •                                                             ~
    

Unexpected token '&' in expression or statement.
Not all parse errors were reported. Correct the reported errors and try again.
At line:1 char:82

  • ... thub.com/ChrisTitusTech/powershell-profile/blob/main/setup.ps1" | iex
  •                                                                   ~~~
    
    • CategoryInfo : ParserError: (:) [Invoke-Expression], ParseException
    • FullyQualifiedErrorId : AmpersandNotAllowed,Microsoft.PowerShell.Commands.InvokeExpressionCommand

Error that never ends

Previously (like a long time ago) i installed it using the one line script and works well. but now on a new fresh windows it doesnt work
image

After a long error, my powershell is now looking like this:
image

Some icons are missing/broken

I have installed the fonts for all users but there are some broken icons and I can't figure out how to fix them
here is a screenshot to demonstrate

image

Suggestion add fastfetch on startup

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.

Fonts ZIP file missing in installation folder?

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?

Suggestion Uptime change

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
}

image
preview of how that looks in powershell, works in both 5 and 7

Terminal Icon for Folder not showing

I ran the profile install command, set the Nerd Fonts, and found that the Folder icon (orange tab in the prompt) isn't showing properly. Tried all the Nerd Fonts that download with the script. Also tried this on two other computers I have (Win10 and Win11) and was able to replicate the issue.

image

image

Cannot bind parameter 'NewerThan'

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.

Lost personal configuration when update

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

Test-connection -TimeSeconds parameter not recongnized (NamedParameterNotFound)

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

  • ... GitHub = Test-Connection github.com -Count 1 -Quiet -TimeoutSeconds 1
  •                                                     ~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Test-Connection], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.TestConnectionCommand

Bitdefender blocking install

Bitdefender says "PowerShell tried to load a malicious resource detected as Heur.BZC.ZFV.Boxter.341.15F94BE2 and was blocked. Your device is safe.:

Terminal Icon Module not loaded

error:

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

  • Import-Module -Name Terminal-Icons

Running setup command problems

When I run the setup command elevated permission on your website the command just keeps showing wget and downloads random bits and never stops.

Suggestion about Oh-My-Posh config change

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.

Uninstall the profile and scripts

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?

Installation broke

image
it starts spewing errors out and lags my computer to kingdom come
I ran the link in the README and it was saying something about execution policy and it continued and now that is happening

Fail on Test-Connection

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

  • ... GitHub = Test-Connection github.com -Count 1 -Quiet -TimeoutSeconds 1
  •                                                     ~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Test-Connection], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.TestConnectionCommand

Web request status endless loop

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

Nothing happens after install

The installation was successful but my powershell looks the same as before. Should I do anything else beside running the script?

Thanks :)

After install
image

Error zoxide

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.

A few issues when running the install...

  1. If chocolaty installed - says old version and need to manually update but continues installation
  2. Installs fonts but prompts for each font to be installed.
  3. If you finish installation and update chocolatey the re-run install, it stops at each font (already installed) and waits for you to click yes or no to installation of each font (takes a few mins to complete the NO all the time)

Cheers and thanks for your great work

Error when running setup script: "The '<' operator is reserved for future use."

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.

Suggestion about Cascadia font.

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:
image
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.

Delete command from curl

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.

powershell script now downloaded cove.zip

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

How to add Terminal icons?

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!

Test-Connection errors

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

  • ... GitHub = Test-Connection github.com -Count 1 -Quiet -TimeoutSeconds 1
  •                                                     ~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Test-Connection], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.TestConnectionCo
      mmand

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

  • oh-my-posh init pwsh --config https://raw.githubusercontent.com/JanDe ...
  •   + CategoryInfo          : ObjectNotFound: (oh-my-posh:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

Loading personal and system profiles took 1109ms.

Oh my Posh

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

issue with $Editor

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'
}

vim editor config

i am not sure if its only with my system but when i typed "vim" i am getting the following error
Screenshot (1834)

Showing Error after entering One Line Install.

Annotation 2022-11-14 210616

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
    
  •      ~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (Cannot bind par...ng at index 0.":String) [], RuntimeExcept
      ion
    • FullyQualifiedErrorId : 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."

error i cant fix in trying to isntall

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?

installation issue.....

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

  • Import-Module -Name Terminal-Icons
  •   + 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.