2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Scoopをセキュリティソフトに邪魔されずに入れたいな

Posted at

発端

Scoopを公式の通りに、

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

でインストールしようとしたらセキュリティソフトに阻まれたので、なんとかインストールする

準備

https://get.scoop.sh の内容をファイルに保存する

https://get.scoop.sh に直アクセスして表示された内容をテキストファイルで保存する
get-scoop.sh などで適当なディレクトリに保存
(ここでは作業ディレクトリとしてc:\tmp\scoop に保存)
念のため改行とかはLFのみにしたり

GitHubからZIPでダウンロード

https://github.com/lukesampson/scoop にアクセスして「Clone or download」から「Download ZIP」でダウンロード

ダウンロードできたらzipそのままを作業ディレクトリに保存
(c:\tmp\scoop\scoop-master.zip)
その後解凍したディレクトリも作業ディレクトリに保存
(c:\tmp\scoop\scoop-master)

get-scoop.sh の書き換え

書き換えが必要な場所は3カ所

31行目
$core_url = 'https://raw.githubusercontent.com/lukesampson/scoop/master/lib/core.ps1'

URLを作業ディレクトリ相当に書き換える
$core_url = 'c:\tmp\scoop\scoop-master\lib\core.ps1'

44行目
$zipurl = 'https://github.com/lukesampson/scoop/archive/master.zip'
zipファイルのパスを書き換える
$zipurl = 'c:\tmp\scoop\scoop-master.zip'

60行目
44行目と同じ

コマンド実行

DownloadString()で呼び出すファイルを、さっきテキストで保存したファイルにする

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('c:\tmp\scoop\get-scoop.sh')
PS C:\tmp\tools> Invoke-Expression (New-Object System.Net.WebClient).DownloadString('c:\tmp\get-scoop.sh')
Initializing...
Downloading scoop...
Extracting...
Creating shim...
Downloading main bucket...
Extracting...
Adding ~\scoop\shims to your path.
'lastupdate' has been set to '2020-04-23T11:01:26.2306095+09:00'
Scoop was installed successfully!
Type 'scoop help' for instructions.
PS C:\tmp\tools>
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?