diff --git a/README.md b/README.md index d3aa8f1..b5b6b4f 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ To use, download the PowerShell script to the machine and create a shortcut to i |`.\Launch-Chrome-Plex.ps1 -Product UX -CompanyCode edgeent` | Company-specific UX session for Edge Enterprises | |`.\Launch-Chrome-Plex.ps1 -Product Classic` | Classic session | +In addition, you can set the flag `-BlankProfile` to avoid copying the Chrome Default profile. This will remove any favorites, plugins, and other customization from the new session, but does significantly cut down on launch time. + ## Using the Scripts PowerShell is a replacement for the Command Prompt in Windows. Windows PowerShell has been installed by default since Windows 7. Versions of Windows back to XP can install PowerShell manually. A cross-platform version of PowerShell, previously called PowerShell Core, also exists for Windows, MacOS, and Linux. All scripts are confirmed to work under both Windows PowerShell (`powershell.exe`) and the cross-platform PowerShell (`pwsh.exe`). @@ -21,4 +23,4 @@ To invoke a PowerShell script, download it from this repository. Advanced users Once the file exists on your machine, create a shortcut to it. For the shortcut path, enter `powershell.exe -ExecutionPolicy Bypass -File ""`, where the path to the script is in quotes. If you wish to pass in additional parameters, you can do so by appending them to the end of the shortcut path: `powershell.exe -ExecutionPolicy Bypass -File "" -Product Classic -CompanyCode edgeent`. -If upon launching your shortcut, nothing happens, try appending `-noexit` after `powershell.exe` to read the error message that appears. \ No newline at end of file +If upon launching your shortcut, nothing happens, try appending `-noexit` after `powershell.exe` to read the error message that appears. diff --git a/browsers/Launch-Chrome-Plex.ps1 b/browsers/Launch-Chrome-Plex.ps1 index 22cf015..ddc7173 100644 --- a/browsers/Launch-Chrome-Plex.ps1 +++ b/browsers/Launch-Chrome-Plex.ps1 @@ -13,13 +13,17 @@ The product to open (`UX` or `Classic`); defaults to `UX` .PARAMETER CompanyCode The company code, used to generate customer-specific URLs for UX + +.PARAMETER BlankProfile +If set, uses a blank profile rather than copying the Default profile #> [CmdletBinding()] Param( [ValidateSet("UX", "Classic")] [string]$Product = "UX", - [string]$CompanyCode = "" + [string]$CompanyCode = "", + [switch]$BlankProfile = $false ) $userData = Join-Path $env:LOCALAPPDATA "\Google\Chrome\User Data\"; @@ -31,7 +35,11 @@ $unixEpoch = (Get-Date 1970-01-01Z).ToUniversalTime(); $id = [System.Math]::Round([System.DateTime]::Now.ToUniversalTime().Subtract($unixEpoch).TotalSeconds); $newDataDir = ($userData + "TempPlexProfile" + $id); -Copy-Item -Path ($userData + "Default\") -Destination $newDataDir -Recurse; +if ($BlankProfile) { + mkdir $newDataDir > $null; +} else { + Copy-Item -Path ($userData + "Default\") -Destination $newDataDir -Recurse; +} if ($Product -eq "Classic") { $url = "https://www.plexonline.com/signon";