ps1

Error running ps1 from c# code (Office 365)

落爺英雄遲暮 提交于 2019-12-25 02:11:50
问题 When creating the sharepoint site using ps1 file from C# code in office365. This error is coming The 'connect-sposervice' command was found in the module 'Microsoft.Online.SharePoint.PowerShell', but the module could not be loaded. For more information, run 'Import-Module Microsoft.Online.SharePoint.PowerShell'. Running the ps1 directly in powershell is giving the desired result, but not working properly using c# code 回答1: I had the same problem and solve it this way: Locate file C:\Program

Where does bash prompt escape sequence \h get the hostname from?

孤街醉人 提交于 2019-12-24 02:13:17
问题 \h is a bash prompt escape sequence that expands to the hostname. Where does it get the hostname from? On my system it shows a value that I cannot find anywhere, not in hostname -f or /etc/hosts or /etc/hostname or /etc/sysconfig/network or $HOSTNAME . So I'm wondering where it's getting it from. My system is Centos 7.4. I know there are hidden places where things such as UUIDs are stored, and I seem to recall that I've come across a similar hidden hostname type of issue in the past, but I

Anaconda environment bash prefix too long

余生长醉 提交于 2019-12-23 18:06:59
问题 I created an anaconda environment in a project folder specifying the path with -p option, i.e. not in the default anaconda3/envs folder: conda create -p venv The problem is that when I activate that environment, the bash prefix in the terminal is too long, i.e. it prepends the entire path of the environment to the prompt: (/path/to/the/environment/venv) user@machine: ~/path/to/environment/$ Is there a way to fix this, meaning make it shorter or delete the prefix from prompt? My $PS1: \[\e]0;

PS1 env variable does not work on mac

不想你离开。 提交于 2019-12-20 10:39:31
问题 I have a script(not written by myself) which shows the git branch/svn branch in my command prompt. Does anyone know why this would not work on mac? It works perfectly in linux. From https://github.com/xumingming/dotfiles/blob/master/.ps1: # Display ps1 with colorful pwd and git status # Acording to Jimmyxu .bashrc # Modified by Ranmocy # -- if type -P tput &>/dev/null && tput setaf 1 &>/dev/null; then color_prompt=yes else color_prompt= fi __repo () { branch=$(type __git_ps1 &>/dev/null && _

Break line in terminal PS1 fix

六月ゝ 毕业季﹏ 提交于 2019-12-18 12:25:23
问题 I have this code to color my terminal: export PS1="\e[1;30m\][\e[\e[1;30m\]\e[1;33m\] \u@\H \[\e[1;32m\]\w\[\e[0m\] \e[1;30m\]]\n[\[ \e[1;31m\]\T\[\e[0m\]\e[1;30m\] ] > \e[37m\]" But I have one problem, when text should be in the new line it overwrites the first line. Example: 回答1: In order for bash to figure out how much screen space your prompt takes up (and therefore where the actual command line starts), you have to enclose the non-printing parts of the prompt in \[...\] . Mostly, that

PowerShell: 如何解决File **.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see \"get- help about_sig\" for more de

送分小仙女□ 提交于 2019-12-18 09:58:55
PowerShell 默认不允许执行*.ps1脚本文件。运行ps1文件会得到下面的错误: File C:\Temp\Test.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get- help about_signing" for more details. At line:1 char:19 + c:\Temp\Test.ps1 <<<< 可以通过Get-ExecutionPolicy,来取得当前策略。 用Set-ExecutionPolicy设置当前策略。 下面的命令可以解决上面的错误 PS C:\Windows\system32> Set-ExecutionPolicy RemoteSigned <按回车> Execution Policy Change The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help

How can I shortern my command line prompt's current directory?

自闭症网瘾萝莉.ら 提交于 2019-12-17 10:14:51
问题 I am using Ubuntu and I am tired of this long prompts in bash when I am working with some deep directory hierarchy. So, I would like to tweak my PS1 to shorten the working directory part the following way: Currently I have: pajton@dragon:~/workspace/projects/project1/folder1/test$ and would like to have: pajton@dragon:~/workspace/.../folder1/test$ The truncating would occur if len($PWD) passes given threshold. I want to always keep the first path component and at least one last path component

(Mac) -bash: __git_ps1: command not found

爱⌒轻易说出口 提交于 2019-12-17 07:58:49
问题 I'm trying to change my command promt in terminal. I keep getting the error: -bash: __git_ps1: command not found I've tried it just by typing it into the terminal as is: __git_ps1 . I've also tried it out in the .bash_profile if [ -f ~/.git-completion.bash ]; then source ~/.git-completion.bash export PS1='[\W]$(__git_ps1 "(%s)"): ' fi As you might be able to see/tell, yes, I do have the auto-completion installed and it does work great! I came across this question: " PS1 env variable does not

How to display git branch in PS1 with other output?

左心房为你撑大大i 提交于 2019-12-14 02:33:48
问题 I got to display just the branch name in the PS1 if I am in a git repo linux PS1 - display branch name only inside a git repo, but I am not able to get it integrated with my earlier PS1, which is PS1="[\D{%F} \@] \u /\W $ " this displays, datetime + username [2015-08-20 11:38 PM] mtk I tried PS1="[\D{%F} \@] \u /\W $(__git_ps1) $ " but, i get error __git_ps1: command not found <empty PS1> Any way to get git branch name along with earlier details that my PS1 used to output? EDIT: I also tried

Linux基础

耗尽温柔 提交于 2019-12-13 00:02:21
命令提示符:prompt [root@localhost ~]# --#表示是root账号,权限比较大 [root@localhost ~]$ --$表示是一般用户,权限相对较小 显示提示符格式: [root@localhost ~]#echo $PS1 修改提示符颜色格式: PS1="\[\e[1;5;41;33m\][\u@\h \W]\\$\[\e[0m\]" 来源: https://www.cnblogs.com/henn/p/12032318.html