ps1

Can you load a ps1 file from within a ps1 file?

can I load a ps1 file from within a ps1 file. The end goal is to make a ps1 file that I put in my profile on all my computers and have a floating profile that I can put paths to pocket utilities in. I'll probably put this in a code repo, or some outside sharing mechanism. ...

Powershell Script to output Installed Programs

I'd like to do this using the win32_product wmi class. I need the script to simply count the number of products installed and also output the time taken to execute the script. What I have atm doesn't seem to work correctly: $count = 0 $products = get-wmiobject -class "Win32_Product" foreach ($product in $products) { ...

Echo expanded PS1

I have a shell script that runs the same command in several directories (fgit). For each directory, I would like it to show the current prompt + the command which will be run there. How do I get the string that corresponds to the decoded (expanded)PS1? For example, my default PS1 is ${debian_chroot:+($debian_chroot)}\[\e[1;32m\]\u\[\e[0m...

Dynamic elements in bash PS1

I have put the following in my ~/.localsh file to customize my bash prompt when working with git. Basically I want to get the current branch displayed in my terminal. The gitk tool shows branches with green background and black foreground, so thats what I'm trying to do. What I have works, but when I press the up arrow on the keyboard ...