Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [ps1]

The tag has no usage guidance.

8 votes
2 answers
14k views

Powershell Get-ChildItem Include\Exclude - simple script not working properly

Im trying to run the following code as a powershell script,but I cant get it to work. 1st,the following works with one -Include item but I cant seem to get it to work with multiple ones. 2nd, the -...
securityghost's user avatar
0 votes
1 answer
1k views

Bash PS1 and single vs. double quotes

I'm a linux and Bash newbie and would like to ask help understanding the role of single and double quotes when assigning the PS1 env var. I wanted to set the terminal to always show the current ...
StoneThrow's user avatar
  • 1,207
0 votes
1 answer
1k views

A task inside my windows task scheduler will cause my server to stop responding

I have the following AppPoolActivation.ps1 file, to call a URL :- [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $request = [System.Net.WebRequest]::Create("https://...
John John's user avatar
  • 285
9 votes
3 answers
50k views

Windows task schduler keep showing 0x41301

I have wrote the following .ps1 file:- [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} $request = [System.Net.WebRequest]::Create("https://localhost/") $response = $...
John John's user avatar
  • 285
-1 votes
1 answer
2k views

NullReferenceException error in powershell

I am a newb in power-shell, i have written an script that stops process according to parameters in commandline. the problem is when i run the script in power shell it works but when i try to run it ...
rmaan's user avatar
  • 1
0 votes
2 answers
176 views

Making PS1 prompt refreshable

I want my prompt to be changed based on an output of a certain command. and based on the command result to add a color. example: run the command: cphaprob stat | grep local | awk '{ print $NF }'` (...
AlonCo's user avatar
  • 3
0 votes
1 answer
538 views

Using \r in bash PS1

I was getting a little tired of my typeaheads in Bash from messing up the PS1. For instance, I would execute a command, like ls, and while it is running, start typing the next command, like echo, and ...
asmeurer's user avatar
  • 570
2 votes
2 answers
3k views

How to insert bash scripts inside the PS1 variable

I made a custom PS1 variable, which is a tremendously confusing. Here is the one that is closest to being fully working: PS1="\n[\e[1;31m]\u@\H[\e[35m] \@ [\e[32m] PWD: \w [\e[1;34m]This folder has ...
SOMN's user avatar
  • 1,121
0 votes
1 answer
958 views

Bash echo color as function output in PS1

I want my PS1 to display (if i'm in a git folder) the branch, and color the branch with red if working dir is dirty, and blue if it's clean. Here is what i came up to IBlack='\e[0;90m' # Nero ...
Francesco Zaffaroni's user avatar
3 votes
1 answer
925 views

bash's command number ( \# ) equivalent in zsh

I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
shrx's user avatar
  • 464
0 votes
1 answer
178 views

How can I style the command being entered in a bash prompt?

While watching this intro video to Brunch, at about t=1:30 the command prompt being used has some very cool styles. The part I'm interested in is how the presenter managed to colour the text being ...
Mark McDonald's user avatar
1 vote
1 answer
9k views

executing powershell scripts via command prompt - win7

I'm having trouble running a powershell script automatically. When every I call or Execute the script, I get a security prompt requesting I enter "R" to run. I have already set the execution policy to ...
Mpit52's user avatar
  • 23
0 votes
2 answers
177 views

Sending special bash characters to a custom function

I read this great article on customizing the bash prompt: http://blog.superuser.com/2011/09/21/customizing-your-bash-command-prompt/ I also read about using 256 colors in bash: http://www.logilab....
Big McLargeHuge's user avatar
1 vote
3 answers
365 views

Is it possible to have environment variables in the path of the working directory : PS1?

I am on Lubuntu and I am using bash. My PS1 (in .bashrc) is : PS1="\w> " I like it because I need to paste the working directory all the time. The problem is that the path is always very long and ...
mthpvg's user avatar
  • 113
1 vote
3 answers
1k views

Colored PS1 string

Clarification: I want __foo to be executed each time the PS1 string is presented in the terminal, not when the PS1 string is constructed (hence its being in quotes). __foo contains logic that examines ...
Will Vousden's user avatar

15 30 50 per page