Ordres per instal·lar Surface sense preguntes, desinstal·lar-lo i detectar-lo des d’eines de desplegament. Només es mostra una ordre quan és segura: la que indica el manifest o el valor per defecte documentat de la tecnologia de l’instal·lador.
Guia relacionada: Instal·lació silenciosa: MSI, NSIS, Inno Setup · Desinstal·lar un programa amb el registre o PowerShell
Amb winget
winget install --id Microsoft.SurfaceApp -e --silent --accept-package-agreements --accept-source-agreementswinget upgrade --id Microsoft.SurfaceApp -e --silentwinget uninstall --id Microsoft.SurfaceApp -e --silentPer instal·lador
64 bits · MSIX
Add-AppxPackage -Path Microsoft.SurfaceHub_76.5120.174.0_Desktop_X64.Arm64.msixbundleGet-AppxPackage -Name Microsoft.SurfaceHub | Remove-AppxPackageARM64 · MSIX
Add-AppxPackage -Path Microsoft.SurfaceHub_76.5120.174.0_Desktop_X64.Arm64.msixbundleGet-AppxPackage -Name Microsoft.SurfaceHub | Remove-AppxPackagePowerShell: baixar, verificar, instal·lar
Baixa el fitxer oficial, en comprova l’SHA256 i l’instal·la en mode silenciós.
$url = 'https://download.microsoft.com/download/1a91fe3e-b6be-465d-bda0-b8f12fd0fca7/Microsoft.SurfaceHub_76.5120.174.0_Desktop_X64.Arm64.msixbundle'
$sha256 = '6A7F09C1F53FB62D8721C0F706C44D86A326F1C6FFED4DFFCCFBB093F8BFC95B'
$file = Join-Path $env:TEMP 'Microsoft.SurfaceHub_76.5120.174.0_Desktop_X64.Arm64.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file $url = 'https://download.microsoft.com/download/1a91fe3e-b6be-465d-bda0-b8f12fd0fca7/Microsoft.SurfaceHub_76.5120.174.0_Desktop_X64.Arm64.msixbundle'
$sha256 = '6A7F09C1F53FB62D8721C0F706C44D86A326F1C6FFED4DFFCCFBB093F8BFC95B'
$file = Join-Path $env:TEMP 'Microsoft.SurfaceHub_76.5120.174.0_Desktop_X64.Arm64.msixbundle'
Invoke-WebRequest -Uri $url -OutFile $file -UseBasicParsing
if ((Get-FileHash $file -Algorithm SHA256).Hash -ne $sha256) { throw 'SHA256 mismatch' }
Add-AppxPackage -Path $file