1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PowerShellでFirefoxやChromeをWindowsにインストール

Last updated at Posted at 2025-02-05

本ブログは、オラクル・クラウドの個人ブログ一覧の1つです。

初めに
このブログは、PowerShellスクリプトを利用してFirefoxやChromeを自動インストールしたい方を対象としています。cloud-initスクリプトに追加することで、Computeインスタンスの作成時に自動的にインストールを実行できるようになります。

動作確認済環境
Windows Server 2019 Standard (OCI VM)
Windows 11

目次

Firefoxのインストール

ステップ

  • インストーラのダウンロード
  • インストール開始(サイレントモード)
  • インストーラの削除(オプション)
$DownloadURL = "https://download.mozilla.org/?product=firefox-latest&os=win64&lang=en-US"
$InstallerFile = Join-Path $env:TEMP "Firefox_Installer.exe"

# Download the Firefox installer
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $DownloadURL -OutFile $InstallerFile

# Unblock the downloaded file
Unblock-File -Path $InstallerFile

# Install Firefox silently
Start-Process -Wait -FilePath $InstallerFile -Args "/S"

# Clean up the installer (optional)
Remove-Item $InstallerFile

上記のダウンロードリンクは英語版です。日本語版のリンクは次となります。
https://download.mozilla.org/?product=firefox-latest&os=win64&lang=ja

Chromeのインストール

ステップは上記と同じで、インストーラURLとファイル名以外の違いは、次です。
インストール・パラメータ:/silent /install

$DownloadURL = "https://dl.google.com/chrome/install/latest/chrome_installer.exe"
$InstallerFile = Join-Path $env:TEMP "ChromeSetup.exe"

# Download the Chrome installer
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri $DownloadURL -OutFile $InstallerFile

# Unblock the downloaded file
Unblock-File -Path $InstallerFile

# Install Chrome silently
Start-Process -Wait -FilePath $InstallerFile -Args "/silent /install"

# Clean up the installer (optional)
Remove-Item $InstallerFile

※、上記のインストーラー(chrome_installer.exe)は多言語対応で、システムのデフォルト言語で自動的にChromeをインストールします。

OCI cloud-initスクリプトで使用する場合は、スクリプトの先頭に#ps1_sysnativeを追加する必要があります。

以上

関連記事
OCI Cloud-initスクリプト

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?