見出し画像

PowerShellでChromeを開く(起動オプション)

PowerShellでChromeを開くときの起動オプションの紹介

基本形

#基本形
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe' -ArgumentList 'https://google.com/'


最大化で開く

#最大化で開く
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe' -ArgumentList '--start-maximized' , 'https://google.com/'


アプリケーションモードで開く

#アプリケーションモードで開く
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe' -ArgumentList '--app=https://google.com/'


シークレットモードで開く

#シークレットモードで開く
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe' -ArgumentList '--incognito' , 'https://google.com/'


新しいウインドウで開く

#新しいウインドウで開く
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe' -ArgumentList '--new-window' , 'https://google.com/'


プロキシサーバーを指定する

#プロキシサーバーを指定する
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe' -ArgumentList '--proxy-server"<アドレス>:<ポート>"' , 'https://google.com/'


プラグイン無効、拡張機能無効、デベロッパーツール無効にする

#プラグイン無効、拡張機能無効、デベロッパーツール無効にする
Start-Process -FilePath 'C:\Program Files\Google\Chrome\Application\chrome.exe' -ArgumentList '--disable-plugins' , '--disable-extensions' , '--disable-dev-tools' , '--new-window' , 'https://google.com/'


変数にしたり、複数指定も可能

#変数にしたり、複数指定も可能
#最大化、シークレットモード、新しいウインドウで開く

$path = 'C:\Program Files\Google\Chrome\Application\chrome.exe'
$option = '--start-maximized --incognito --new-window'
$url = 'https://google.com/'
Start-Process -FilePath $path -ArgumentList $option , $url 


#PowerShell #コマンドレット #Chrome #プログラミング #Windows #毎日更新

この記事が気に入ったらサポートをしてみませんか?