Ash258 / Scoop-Core

Shovel. Alternative, more advanced, and user-friendly implementation of windows command-line installer scoop.

Home Page:https://shovel.ash258.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't uninstall pwsh

Unrepentant-Atheist opened this issue · comments

  • Branch: main

  • Powershell Version:
    5.1.19041.1320
    7.2.1

When I try to shovel uninstall pwsh this is what I get

ConvertFrom-Json : Invalid JSON primitive: version.
At D:\xxx\Scoop\apps\scoop\current\lib\manifest.ps1:40 char:27
+ ...   $result = ConvertFrom-Json -InputObject $content -ErrorAction 'Stop ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [ConvertFrom-Json], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.ConvertFromJsonCommand

ERROR Invalid JSON primitive: version.

image

image

You have yaml manifest saved as json

Result of: gci "$(shovel prefix pwsh)\scoop-*"? And content of the scoop-install.json, scoop-manifest.* files?

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          11/01/2022    09:19             60 scoop-install.json
-a---          17/12/2021    08:26           2525 scoop-manifest.yml

scoop-install.json:

{
    "bucket": "Ash258",
    "architecture": "64bit"
}

scoop-manifest.yml:

version: 7.2.1
description: PowerShell Core. Cross-Platform task automation and configuration management framework/tool.
homepage: https://github.com/PowerShell/PowerShell
license:
  identifier: MIT
  url: https://github.com/PowerShell/PowerShell/blob/master/LICENSE.txt
changelog: https://github.com/PowerShell/PowerShell/releases/tag/v7.2.1
architecture:
  64bit:
    url: https://github.com/PowerShell/PowerShell/releases/download/v7.2.1/PowerShell-7.2.1-win-x64.zip
    hash: d08aae1cbf53ca3eca6efccb03b00178960bed6dac5d151e83bb67a187c7e097
  32bit:
    url: https://github.com/PowerShell/PowerShell/releases/download/v7.2.1/PowerShell-7.2.1-win-x86.zip
    hash: a8916e7c35d4675fb09ade0ab7161a4436606838513dd68d3c80d73cc3f7f4b5
  arm64:
    url: https://github.com/PowerShell/PowerShell/releases/download/v7.2.1/PowerShell-7.2.1-win-arm64.zip
    hash: 22eb1737db326cb51c1acd208300e61c80933dd8cbe11e8708122948413bb034
pre_install: |
  Test-Persistence 'Microsoft.PowerShell_profile.ps1', 'profile.ps1'

  #### Variables
  $GIST = 'https://gist.githubusercontent.com/Ash258/e143436e2f9183a650424d635b535e51/raw'
  $PWSH_PATH = "$dir".Replace('\', '\\')
  $INS_REG = "$dir\pwsh-context-ins.reg"
  $UNINS_REG = "$dir\pwsh-context-un.reg"

  #### Downloading
  $content = (New-Object System.Net.WebClient).DownloadString("$GIST/pwsh-context-ins.reg")
  $content = $content.Replace('%%dir%%', $PWSH_PATH)
  #### SET FILES
  Out-UTF8File $INS_REG $content
  $content = (New-Object System.Net.WebClient).DownloadString("$GIST/pwsh-context-un.reg")
  Out-UTF8File $UNINS_REG $content
  #### Append registry
  regedit /s $INS_REG
pre_uninstall: |
  #### Remove registry entry
  regedit /s "$dir\pwsh-context-un.reg"
bin:
- - pwsh.exe
  - pwsh
  - -NoLogo
shortcuts:
- - pwsh.exe
  - PowerShell Core
  - -NoLogo
persist:
- Microsoft.PowerShell_profile.ps1
- profile.ps1
checkver:
  github: https://www.github.com/PowerShell/PowerShell
autoupdate:
  archive: true
  changelog: https://github.com/PowerShell/PowerShell/releases/tag/v$version
  architecture:
    64bit:
      url: https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-x64.zip
    32bit:
      url: https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-x86.zip
    arm64:
      url: https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-arm64.zip
  hash:
    url: $baseurl/hashes.sha256

But the issue is resolved, I just deleted the pwsh folder and reinstalled pwsh.

  1. Not a single reason why to use my bucket for pwsh...
  2. Since the pwsh is identified as failed I suspect there is only current file in the pwsh apps folder, which indicate your previous uninstall failed for different reason than this.

What's wrong with using your bucket?? I like your bucket. Should I use main instead?

image

I just do shovel install pwsh and this is the bucket it chooses from.