DEV Community

Cover image for My powershell configuration

My powershell configuration

Diego on November 18, 2020

Preview At the end of this guide your terminal will be like this. Index Installing Windows Terminal (Optional) Installing ...
Collapse
 
seefer007 profile image
Darren Evans

Powershell on my laptop and desktop PC point to the same .ps1 file on my OneDrive. I created two oh-my-posh themes, one for my desktop that does not display battery status and one for my laptop that does display battery status.

How do I load a theme depending on whether it's my laptop running PowerShell or my desktop if PowerShell on both my machines is pointing to the same .ps1 $profile in OneDrive? I suspect I need to have my laptop and desktop PowerShell $profile variable pointing to a file stored locally on the respective machine. How do I do this?

Collapse
 
dialguiba profile image
Diego

Hello, why dont you create a conditional in your profile that could load a different theme depending on information about the system?. I think that you can retrieve information about your system using get-computerInfo.
docs.microsoft.com/en-us/powershel...

Collapse
 
gbursson profile image
Greg R.

Is everything ok with Sudo command link?

Collapse
 
dialguiba profile image
Diego • Edited

Hello! yes. I use it :)
image

Collapse
 
gbursson profile image
Greg R.

There is no host in the URL...

Thread Thread
 
dialguiba profile image
Diego

I am sorry. I didn't notice that.
Here it is github.com/dialguiba/PowerShellCon...

Collapse
 
jandedobbeleer profile image
Jan De Dobbeleer

Hey Diego. First off, thanks for using oh-my-posh. I just dropped in to let you know we’ve been working on V3, which supports every shell you’ll find on Windows and more. Check the website for more information. ohmyposh.dev/

Collapse
 
dialguiba profile image
Diego

Thank you so much. I am gonna see it. Amazing work!

Collapse
 
therajuahammad profile image
Raju Ahammad

How to remove this?

Collapse
 
dialguiba profile image
Diego • Edited

Hello, have you recently installed it? If i am not bad, the new version have an easier way to change the themes than before. In the theme's folder you can modify the json of your theme or you can create another. It contains what you want to show. Which theme are you using?

Collapse
 
therajuahammad profile image
Raju Ahammad

Hi,
Thanks for your reply. Yes, I installed it recently. I'm using "agnoste" theme. Where is the folder location of theme JSON?

Thread Thread
 
dialguiba profile image
Diego • Edited

At the end of this page. It explains you how to personalize a theme in powershell. ohmyposh.dev/docs/installation
And here you have some of the things that you can add to your theme.
ohmyposh.dev/docs/configure
I would like to test it but i dont have windows right now 😔
Hope it helps you