website
website copied to clipboard
pretty-powershell/
the one link command is not using a raw link btw
As @REVENGE977 stated earlier
Fixed: irm "https://raw.githubusercontent.com/ChrisTitusTech/powershell-profile/main/setup.ps1" | iex
Need to add Xargs (I forget where I got this from but it works great!)
function Xargs { param( $Cmd ) process { $args += ,$_ } end { & $Cmd @args } }
After installing this, I now receive a ParserError
Line | 125 | if (( $+commands[nvim] )); then | ~ | Missing statement block after if ( condition ).
Nothing changes after installing this. I've installed the font, but it all looks the same. Thanks.
Test-CommandExists doesnt exist in my installation of Powershell v7.2.7
The one -click install gives me this antivirus response..
irm "https://github.com/ChrisTitusTech/powershell-profile/blob/main/setup.ps1" | iex
Suspicious activity blocked 2 minutes ago
Feature: Antivirus
PowerShell tried to load a malicious resource detected as Heur.BZC.ZFV.Boxter.341.1359F945 and was blocked. Your device is safe.
I turned off my antivirus to get this script to run. After it completed, I now get this PowerShell error
. : File C:\Users\virtualtom\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3
- . 'C:\Users\virtualtom\Documents\WindowsPowerShell\Microsoft.PowerShe ...
-
+ CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
I get the following error when trying to install the program. Any suggestions?
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 & 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
having same issue as hiddengerbil it is showing me . : File C:\Users\Rishab\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3
- . 'C:\Users\Rishab\Documents\WindowsPowerShell\Microsoft.PowerShell_p ...
-
+ CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
Having this issue after install:
Set-Alias : Cannot bind the argument to the 'Value' parameter because it is null.
In F:__Documents_WindowsPowerShell__Microsoft.PowerShell_profile.ps1: 142 Character: 28
+ Set-Alias -Name vim -Value $EDITOR
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Set-Alias], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SetAliasCom
mand
Having the same error.. as above.
Set-Alias : Cannot bind argument to parameter 'Value' because it is null.
At C:\Users\grant\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:142 char:28
+ Set-Alias -Name vim -Value $EDITOR
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Set-Alias], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SetAliasCom
mand
How Do I backup my current profile?
How Do I backup my current profile?
the script auto-backup current profile as oldprofile.ps1
@PapaHawk14 and @TheKeiki
That is because you don't have nvim/vim/pvim/vi installed If you don't intend to use any of those, just remove that part out from the profile
Done - awesome….
On Tue, 1 Nov 2022 at 3:40 pm, Velosofy @.***> wrote:
@PapaHawk14 https://github.com/PapaHawk14 and @TheKeiki https://github.com/TheKeiki
That is because you don't have nvim/vim/pvim/vi installed If you don't intend to use any of those, just remove that part out from the profile
— Reply to this email directly, view it on GitHub https://github.com/ChrisTitusTech/website/issues/72#issuecomment-1298036856, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVHPCV7GAVENLEONQGA3L3DWGCQ2ZANCNFSM6AAAAAARTCTNQE . You are receiving this because you were mentioned.Message ID: @.***>
--
Grant Hawksworth Adelaide Sth Australia email: @.***
I also had some issues with the script execution which I resolved by doing this before executing the script above:
Set-ExecutionPolicy Bypass Process
OR
Set-ExecutionPolicy RemoteSigned
The script is working good and shows up perfectly on powershell but in Windows terminal some icons are missing.
OS: Windows 10 Pro.
I also had some issues with the script execution which I resolved by doing this before executing the script above:
Set-ExecutionPolicy Bypass Process
OR
Set-ExecutionPolicy RemoteSigned
The script is working good and shows up perfectly on powershell but in Windows terminal some icons are missing.
OS: Windows 10 Pro.
The template does indeed require a
Set-ExecutionPolicy RemoteSigned
Are you sure you're using the right font?
Are you sure you're using the right font?
Yes, I am sure. As suggested in the article:
- I unzipped the cove.zip
- Installed all the 4 fonts present there
- and then made the default font for Windows Terminal as "Caskaydia Cove Nerd Font"
In powershell it is looking fine.
Yes, I am sure.
Possible of the "Windows PowerShell" terminal profile overriding the "default" profile font?
Possible of the "Windows PowerShell" terminal profile overriding the "default" profile font?
You were right. I changed it as well and it worked.
Thanks
I have the same issue as Khurram-hassan it seems. How do i override the default profile font?
I have the same issue as Khurram-hassan it seems. How do i override the default profile font?
Assuming we're talking Windows Terminal - By simply changing the font for the default profile, but seems like you need to change the font for powershell profile aswell
The following error can be removed from the profile.ps1 files. You should be able to find it in your My Documents\WindowsPowerShell folder called "Microsoft.PowerShell_profile.ps1" and "Microsoft.PowerShellISE_profile.ps1"
Edit the file and remove the following lines:
if (Test-CommandExists nvim) { $EDITOR='nvim' } elseif (Test-CommandExists pvim) { $EDITOR='pvim' } elseif (Test-CommandExists vim) { $EDITOR='vim' } elseif (Test-CommandExists vi) { $EDITOR='vi' } Set-Alias -Name vim -Value $EDITOR"
Save the file and now you can open Powershell and ISE without the error.
It does not seem to be assigning the correct value at the moment. I will look more into this later.
Error:
Set-Alias : Cannot bind argument to parameter 'Value' because it is null. At F:\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:142 char:28
- Set-Alias -Name vim -Value $EDITOR
~~~~~~~
- CategoryInfo : InvalidData: (:) [Set-Alias], ParameterBindingValidationException
- FullyQualifiedErrorId : >ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SetAliasCom mand
I'm getting this error: Could not find a part of the path 'C:\Users\lukav\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'. At line:8 char:10
-
throw $_.Exception.Message
-
~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : OperationStopped: (Could not find ...l_profile.ps1'.:String) [], RuntimeException
- FullyQualifiedErrorId : Could not find a part of the path 'C:\Users\lukav\Documents\WindowsPowerShell\Microsoft.PowerSh ell_profile.ps1'.
The following error can be removed from the profile.ps1 files. You should be able to find it in your My Documents\WindowsPowerShell folder called "Microsoft.PowerShell_profile.ps1" and "Microsoft.PowerShellISE_profile.ps1"
Edit the file and remove the following lines:
if (Test-CommandExists nvim) { $EDITOR='nvim' } elseif (Test-CommandExists pvim) { $EDITOR='pvim' } elseif (Test-CommandExists vim) { $EDITOR='vim' } elseif (Test-CommandExists vi) { $EDITOR='vi' } Set-Alias -Name vim -Value $EDITOR"
Save the file and now you can open Powershell and ISE without the error.
It does not seem to be assigning the correct value at the moment. I will look more into this later.
Error:
Set-Alias : Cannot bind argument to parameter 'Value' because it is null. At F:\My Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:142 char:28
Set-Alias -Name vim -Value $EDITOR
~~~~~~~
- CategoryInfo : InvalidData: (:) [Set-Alias], ParameterBindingValidationException
FullyQualifiedErrorId : >ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.SetAliasCom mand
The problem is none of these editors are installed on the machine or if they are installed they are not in the system's PATH variable.
You can absolutely remove this chunk of code and be fine, but if you wanted a "vim" alias for a quick file editor you can add elseif statements for things you do have installed and are in the path
Case in point
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 notepad) {
$EDITOR='notepad'
}
Set-Alias -Name vim -Value $EDITOR
doing notepad last as every machine has notepad.
I added the function gotodir. Simply go to the directory even if the parameter is a file.
gd $PROFILE
just add this to youre profile file.
go to a directory even in path is a file.
added 02-nov-2022
function gotodir($dir) { if ((get-item $dir -erroraction silentlycontinue ) -is [system.io.directoryinfo]) { cd $dir } else { cd (split-path -path $dir) } } set-alias -name gd -value gotodir <.sub>
Sorry for my previous post, I accidentally posted it too soon. I hoop you will delete it.
I added the function gotodir. Simply go to the directory even if the parameter is a file.
gd $PROFILE
just add this to youre profile file.
#go to a directory even in path is a file.
#added 02-nov-2022
function gotodir($dir) {
if ((get-item $dir -erroraction silentlycontinue ) -is [system.io.directoryinfo]) {
cd $dir
} else {
cd (split-path -path $dir)
}
}
set-alias -name gd -value gotodir
For all the EDITOR messages, just put this on line 133 just before the 'if (Test-CommandExists nvim) {' So the editor will be notepad if none of the other commands exist.
$EDITOR="notepad.exe"
I just fixed my error. Also can you do something with cmd too?
I get the following error:
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS C:\Users\lexus> irm "https://github.com/ChrisTitusTech/powershell-profile/blob/main/setup.ps1" | iex
Invoke-Expression:
Line |
1 | … thub.com/ChrisTitusTech/powershell-profile/blob/main/setup.ps1" | iex
| ~~~
| The '<' operator is reserved for future use.
PS C:\Users\lexus>
Any thoughts what I am doing wrong?