33 lines
1.4 KiB
PowerShell
33 lines
1.4 KiB
PowerShell
# Copyright (c) 2026 Probo Inc <hello@getprobo.com>.
|
|
#
|
|
# Permission to use, copy, modify, and/or distribute this software for any
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
# copyright notice and this permission notice appear in all copies.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
# PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
[CmdletBinding()]
|
|
param(
|
|
[string]$AgentPath = "$env:ProgramFiles\Probo\probo-agent.exe"
|
|
)
|
|
|
|
if (-not (Test-Path -LiteralPath $AgentPath)) {
|
|
throw "probo-agent executable not found at $AgentPath"
|
|
}
|
|
|
|
$protocolRoot = "HKCU:\Software\Classes\probo"
|
|
$commandRoot = Join-Path $protocolRoot "shell\open\command"
|
|
|
|
New-Item -Path $commandRoot -Force | Out-Null
|
|
Set-ItemProperty -Path $protocolRoot -Name "(Default)" -Value "URL:Probo Enrollment Protocol"
|
|
Set-ItemProperty -Path $protocolRoot -Name "URL Protocol" -Value ""
|
|
Set-ItemProperty -Path $commandRoot -Name "(Default)" -Value "`"$AgentPath`" `"%1`""
|
|
|
|
Write-Host "Registered probo:// protocol for current user."
|