Open raikesy opened 5 years ago
Could you try to install the updated one 0.2019.01.13
to see if it works?
@h404bi Identical results with 0.2019.01.13
Edit: Wait sorry, not identical.
Output with existing $profile (but no pshazz init line):
Updating Scoop...
Updating 'extras' bucket...
Updating 'java' bucket...
Updating 'retools' bucket...
Scoop was updated successfully!
WARN Scoop uses 'aria2c' for multi-connection downloads.
WARN Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
Installing 'pshazz' (0.2019.01.13) [64bit]
Loading e0cbd3fe165ea194a0d2e58001306b9cab22aa56.zip from cache.
Checking hash of e0cbd3fe165ea194a0d2e58001306b9cab22aa56.zip ... ok.
Extracting e0cbd3fe165ea194a0d2e58001306b9cab22aa56.zip ... done.
adding pshazz to your powershell profile
out-file : Access to the path 'C:\Users\jzrai\Documents\PowerShell\Microsoft.PowerShell_profile.ps1' is denied.
At C:\Users\jzrai\scoop\apps\pshazz\0.2019.01.13\bin\install.ps1:16 char:2
+ $new_profile > $profile
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Out-File], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.OutFileCommand
_ _
_ __ ___| |__ __ _ _______| |
| '_ \/ __| '_ \ / _` |_ /_ / |
| |_) \__ \ | | | (_| |/ / / /|_|
| .__/|___/_| |_|\__,_/___/___(_)
|_|
Linking ~\scoop\apps\pshazz\current => ~\scoop\apps\pshazz\0.2019.01.13
Creating shim for 'pshazz'.
'pshazz' (0.2019.01.13) was installed successfully!
Output with no $profile:
Updating Scoop...
Updating 'extras' bucket...
Updating 'java' bucket...
Updating 'retools' bucket...
Scoop was updated successfully!
WARN Scoop uses 'aria2c' for multi-connection downloads.
WARN Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
Installing 'pshazz' (0.2019.01.13) [64bit]
Loading e0cbd3fe165ea194a0d2e58001306b9cab22aa56.zip from cache.
Checking hash of e0cbd3fe165ea194a0d2e58001306b9cab22aa56.zip ... ok.
Extracting e0cbd3fe165ea194a0d2e58001306b9cab22aa56.zip ... done.
out-file : Could not find file 'C:\Users\jzrai\Documents\PowerShell\Microsoft.PowerShell_profile.ps1'.
At C:\Users\jzrai\scoop\apps\pshazz\0.2019.01.13\bin\install.ps1:4 char:2
+ '' > $profile
+ ~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], FileNotFoundException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
gc : Cannot find path 'C:\Users\jzrai\Documents\PowerShell\Microsoft.PowerShell_profile.ps1' because it does not exist.
At C:\Users\jzrai\scoop\apps\pshazz\0.2019.01.13\bin\install.ps1:10 char:9
+ $text = gc $profile
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\jzrai\...ell_profile.ps1:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
adding pshazz to your powershell profile
out-file : Could not find file 'C:\Users\jzrai\Documents\PowerShell\Microsoft.PowerShell_profile.ps1'.
At C:\Users\jzrai\scoop\apps\pshazz\0.2019.01.13\bin\install.ps1:16 char:2
+ $new_profile > $profile
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (:) [Out-File], FileNotFoundException
+ FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
_ _
_ __ ___| |__ __ _ _______| |
| '_ \/ __| '_ \ / _` |_ /_ / |
| |_) \__ \ | | | (_| |/ / / /|_|
| .__/|___/_| |_|\__,_/___/___(_)
|_|
Linking ~\scoop\apps\pshazz\current => ~\scoop\apps\pshazz\0.2019.01.13
Creating shim for 'pshazz'.
'pshazz' (0.2019.01.13) was installed successfully!
Looks like your $PROFILE
is read-only and cannot be rewritten.
Yes but even if I delete it, pshazz can't create a new one, so it can't be to do with the permissions on the file, because the file has been deleted.
I got the same error and, for me, Windows Defender was blocking access. This is in my event log:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe has been blocked from modifying %userprofile%\OneDrive\Documents\WindowsPowerShell by Controlled Folder Access.
I was able to get by this by turning Windows Defender real time protection off, running scoop install pshazz
and then turning Windows Defender real time protection back on again.
It should also work if you add C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
to the list of apps that have Controlled Folder Access, but I don't know what the security implications would be. I'm guessing MS would have already done this if they thought it was safe.
T
I got the same error and, for me, Windows Defender was blocking access. This is in my event log:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe has been blocked from modifying %userprofile%\OneDrive\Documents\WindowsPowerShell by Controlled Folder Access.
I was able to get by this by turning Windows Defender real time protection off, running
scoop install pshazz
and then turning Windows Defender real time protection back on again.It should also work if you add
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
to the list of apps that have Controlled Folder Access, but I don't know what the security implications would be. I'm guessing MS would have already done this if they thought it was safe.
Thanks so much. That helped me.
NB I don't believe this issue is related to #73 Using PowerShell Core 6.1.1
I have a profile in the default location
C:\Users\jzrai\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
with a few lines in it. Runningscoop install pshazz
fails and gives the following output:It seems to be permissions related but running
Get-Acl
on the profile file gives the same result as on any other file that I can access without problem.Then I deleted the profile file and re-ran the installer so it could create a fresh profile but this also failed, giving output:
This seems like something weird with my environment but I have no idea what's causing it and even so I think the installation would be better off failing gracefully rather than "semi-installing" as currently occurs (runs pshazz in current window but obviously on next startup)