Open utterances-bot opened 1 year ago
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
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
I get the following error when trying to install the program. Any suggestions?
iex : At line:198 char:17
Unexpected token 'Jump' in expression or statement.
At line:1726 char:153
+ 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
+ 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:
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
+ 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.
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?
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?
Try the script with the latest Powershell v7
I get the same, Powershell 7.2.7
@numb699 @Helix70
Try with this command instead
irm "https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1" | iex
I get the same, Powershell 7.2.7
This should do the trick:
irm "https://raw.githubusercontent.com/ChrisTitusTech/powershell-profile/main/setup.ps1" | iex
Hello, everything seems to work except oh-my-posh. It appears to have installed but I am getting these errors when attempting to run the extracted command directly since my color scheme is not like the one Chris demonstrated.
system32 oh-my-posh --init --shell pwsh --config ~/jandedobbeleer.omp.json | Invoke-Expression Get-PSReadLineKeyHandler : A parameter cannot be found that matches parameter name 'Key'. At line:373 char:43
+ CategoryInfo : InvalidArgument: (:) [Get-PSReadLineKeyHandler], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.GetKeyHandlerCommand
Get-PSReadLineKeyHandler : A parameter cannot be found that matches parameter name 'Key'. At line:376 char:43
+ CategoryInfo : InvalidArgument: (:) [Get-PSReadLineKeyHandler], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.GetKeyHandlerCommand
CORRECTION TO MY PRIOR COMMENT: Color scheme is set to One Half Dark in Terminal settings for Appearance for powershell. Not sure what the problem is with oh-my-posh with those errors. How do I know if oh-my-posh is working correctly? Thanks.
Could be my PS version 5 is not compatible with those KeyHandler calls for params Enter and Spacebar. Maybe I have to be upgraded to 7 for these bindings to take.
After installing PowerShell extension for vscode, the linter gives the following warning: "The cmdlet 'reload-profile' uses an unapproved verb."
Anyone have any ideas what I can check for the problems Get-PSReadLineKeyHandler? I am getting the same errors when running the reload-profile function. Even when I try to reload my profile by doing . $PROFILE I am getting the same errors for KeyHandler read line; A parameter cannot be found that matches parameter name 'Key' , for both Enter and Spacebar.
Solved by doing the following in Admin pwrsh:
Install-Module PowerShellGet -Force Update-Module PowerShellGet -Force Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck
@numb699 @Helix70 Try with this command instead
irm "https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1" | iex
Thanks numb699, already using 7.2.7 in Administrator mode, tried both commands, results below:
PowerShell 7.2.7
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> irm "https://github.com/ChrisTitusTech/powershell-profile/raw/main/setup.ps1" | iex
Exception:
Line |
8 | throw $_.Exception.Message
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
| Could not find a part of the path 'C:\Users\lexus\OneDrive\Documents\PowerShell\Microsoft.PowerShell_profile.ps1'.
PS C:\Users\lexus>
Ok, after creating the powershell directory under the Onedrive directory, the raw version of the command seems to have worked. Thanks.
Yeah I tried both as well, getting same errors no matter where I run them.
Thanks @jo20201 but I still get this error:
Cannot bind parameter 'NewerThan'. Cannot convert value "True" to type "System.DateTime". Error: "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0." At line:19 char:10
+ CategoryInfo : OperationStopped: (Cannot bind par...ng at index 0.":String) [], RuntimeException
+ FullyQualifiedErrorId : Cannot bind parameter 'NewerThan'. Cannot convert value "True" to type "System.DateTime"
. Error: "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0."
Hi There... I have a problem running the script in powershell admin
Cannot bind parameter 'NewerThan'. Cannot convert value "True" to type "System.DateTime". Error: "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0." At line:19 char:10
+ CategoryInfo : OperationStopped: (Cannot bind par...ng at index 0.":String) [], RuntimeException
+ FullyQualifiedErrorId : Cannot bind parameter 'NewerThan'. Cannot convert value "True" to type "System.DateTime"
. Error: "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0."
Does anyone know how to solve this?
having this error in another computer Cannot bind parameter 'NewerThan'. Cannot convert value "True" to type "System.DateTime". Error: "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0." At line:19 char:10
+ CategoryInfo : OperationStopped: (Cannot bind par...ng at index 0.":String) [], RuntimeException
+ FullyQualifiedErrorId : Cannot bind parameter 'NewerThan'. Cannot convert value "True" to type "System.DateTime"
. Error: "The string was not recognized as a valid DateTime. There is an unknown word starting at index 0."
Looking good except for these little artifacts. I suspect it's because I have Acrylic enabled in Terminal. What do you think?
Help please I have done everything and still cannot get the font to save, it's in the list of fonts but, I struggling to work out how I've gone wrong, I will admit to being a bit of a noob, with a hunger to learn. thanks in advance for any help
@VeritasHurtz Reinstall the Caskaydia cove font but systemwide. Just right click the font and do it through the gui.
@ChrisTitusTech how can i unistall your script?
Pretty Powershell
Having Fun with Technology
https://christitus.com/pretty-powershell/