gpt4 book ai didi

powershell - 使用 powershell 远程处理安装 Windows 10 应用程序

转载 作者:行者123 更新时间:2023-12-04 21:11:09 26 4
gpt4 key购买 nike

我一直在尝试安装带有 powershell 远程处理的 Windows 10 通用应用程序,但无济于事。我已经尝试了所有我能想到的,所以现在我转向你,希望有人可以为我提供答案或解释为什么我的方法不起作用。替代解决方案也受到赞赏。

基本上我想要做的是能够远程安装 Windows 10 应用程序,我的方法包括将文件下载到目标计算机并使用 powershell 远程处理运行安装。这是我的脚本的简化版本:

$computerName = 'XYZ'
$userName = 'abc'
$newCred = Get-Credential "$computerName\$userName"
$newSession = New-PSSession -ComputerName $computerName -Credential $newCred -ErrorAction Stop
Invoke-Command -Session $newSession -ErrorAction Stop -Verbose -Scriptblock {

function installApp($srcDirectory) {
$installer = Get-ChildItem "$srcDirectory\App.Test*\Add-AppDevPackage.ps1" | Select-Object -ExpandProperty FullName
&($installer)
}

$srcDirectory = "$($env:TEMP)/TestApp"
installApp($srcDirectory)
}

Remove-PSSession $newSession

本质上,它试图做的就是运行在 Visual Studio 中生成的脚本以安装应用程序。但是当我运行它时,我得到以下信息:
Installing app...

Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF6, Det gick inte att registrera paketet.

error 0x80070005: Adding a tile failed with unexpected error.

NOTE: For additional information, look for [ActivityId] a3f9b89b-3292-000113ea-f9a39232d101 in the Event Log or use the command line Get-AppxLog -ActivityID a3f9b89b-3292-0001-13ea-f9a39232d101

At C:\Users\abc\AppData\Local\Temp\App\TestApp_1_0_0\Add-AppDevPackage.ps 1:392 char:13
+ Add-AppxPackage -Path $DeveloperPackagePath.FullName -
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : (C:\Users\abc..._arm.appxbundle:String) [Add-AppxPackage], IOException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand

Error: Could not install the app.

以及来自 的输出Get-AppxLog -ActivityID a3f9b89b-3292-0001-13ea-f9a39232d101 是:
Time                      ID           Message                                                                                                                          
---- -- -------
2015-12-10 10:45:39 301 The calling process is wsmprovhost.exe
2015-12-10 10:45:39 603 Started deployment Add operation on a package with main parameter: Test.App_1.1.1.0_x86_x64_arm.appxbundle and Options: Fo
rceApplicationShutdownOption. See http://go.microsoft.com/fwlink/?LinkId=235160 for help diagnosing app deployment issues.
2015-12-10 10:45:40 164 The app bundle signature was validated for core content of the app bundle published by CN=xxx. App packages won't be validated
until they are read.
2015-12-10 10:45:40 391 The bundle streaming reader was created successfully for bundle 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_neutra
l_~_m042xdac27ax6.
2015-12-10 10:45:40 10002 Creating Resiliency File C:\ProgramData\Microsoft\Windows\AppRepository\d195e8d8-35c4-4b85-bb4f-d99c525791c1_S-1-5-21-3220428687-
2095128414-3811769907-1077_1.rslc for Add Operation on Package 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_neutral
_~_m042xdac27ax6.
2015-12-10 10:45:40 607 Deployment Add operation on package 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_neutral_~_m042xdac27ax6 has been d
e-queued and is running for user XYZ\abc.
2015-12-10 10:45:40 613 Adding uri to the list of Uris: file:///C:/Users/abc/AppData/Local/Temp/TestApp/Test.App_1
.1.1.0_Test/Test.App_1.1.1.0_x86_x64_arm.appxbundle.
2015-12-10 10:45:40 614 Bundle Uri file:///C:/Users/abc/AppData/Local/Temp/TestApp/Test.App_1.1.1.0_Test/Artologik
.Kiosk_1.1.1.0_x86_x64_arm.appxbundle contains packages: "Test.App_1.1.1.0_x86.appx": 588388d0-5c5f-41e1-8965-f8ed6a2644.TestApp
_1.1.1.0_x86__m042xdac27ax6 "Test.App_1.1.1.0_x64.appx": 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_
1.1.1.0_x64__m042xdac27ax6 "Test.App_1.1.1.0_ARM.appx": 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_arm__m0
42xdac27ax6.
2015-12-10 10:45:40 157 The app package signature was validated for core content of the app package published by CN=xxx. Payload won't be validated unt
il the files are read.
2015-12-10 10:45:40 170 The streaming reader was created successfully for app package 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_x86__m04
2xdac27ax6.
2015-12-10 10:45:40 613 Adding uri to the list of Uris: file:///C:/Users/abc/AppData/Local/Temp/TestApp/Test.App_1
.1.1.0_Test/Test.App_1.1.1.0_x86_x64_arm.appxbundle\Test.App_1.1.1.0_x86.appx.
2015-12-10 10:45:41 446 GetFullyQualifiedReference from the Main Resource Map for package full name: 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1
.1.1.0_x86__m042xdac27ax6 and reference string: Test.App failed.
2015-12-10 10:45:41 446 GetFullyQualifiedReference from the Main Resource Map for package full name: 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1
.1.1.0_x86__m042xdac27ax6 and reference string: xxx failed.
2015-12-10 10:45:41 446 GetFullyQualifiedReference from the Main Resource Map for package full name: 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1
.1.1.0_x86__m042xdac27ax6 and reference string: Test.App failed.
2015-12-10 10:45:41 446 GetFullyQualifiedReference from the Main Resource Map for package full name: 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1
.1.1.0_x86__m042xdac27ax6 and reference string: Test.App failed.
2015-12-10 10:45:41 446 GetFullyQualifiedReference from the Main Resource Map for package full name: 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1
.1.1.0_x86__m042xdac27ax6 and reference string: default.html failed.
2015-12-10 10:45:42 10000 About to service package 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_x86__m042xdac27ax6. Setting the package state
to disabled returned with 0x80070490.
2015-12-10 10:45:42 827 Capability parsing started for the package 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_x86__m042xdac27ax6
2015-12-10 10:45:42 5060 error 0x80070005: Adding a tile failed with unexpected error.
2015-12-10 10:45:42 303 error 0x80070005: While preparing to process the request, the system failed to register the windows.visualElements extension due
to the following error: Access is denied.
.
2015-12-10 10:45:42 300 error 0x80070005: Cannot register the 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_m042xdac27ax6 package due to the followi
ng error: Access is denied.
.
2015-12-10 10:45:42 605 The last successful state reached was ResolvedDeferredRegistrations. Failure occurred before reaching the next state Registration
Changed.
2015-12-10 10:45:42 472 Moving package folder \\?\C:\Program Files\WindowsApps\588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_neutral_~_m042x
dac27ax6 to \\?\C:\Program Files\WindowsApps\Deleted\588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_neutral_~_m042xda
c27ax67380de84-c8fa-4c14-a532-e6f2a1242a48. Result: 0x0.
2015-12-10 10:45:42 472 Moving package folder \\?\C:\Program Files\WindowsApps\588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_x86__m042xdac27
ax6 to \\?\C:\Program Files\WindowsApps\Deleted\588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_x86__m042xdac27ax60605
8072-2034-461b-a9ba-a085b10152a7. Result: 0x0.
2015-12-10 10:45:42 10001 Finished servicing package 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_x86__m042xdac27ax6. Setting the package sta
te to enabled returned with 0x0.
2015-12-10 10:45:42 401 Deployment Add operation with target volume C: on Package 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_neutral_~_m0
42xdac27ax6 from: (Test.App_1.1.1.0_x86_x64_arm.appxbundle) failed with error 0x80073CF6. See http://go.microsoft.com/fw
link/?LinkId=235160 for help diagnosing app deployment issues.
2015-12-10 10:45:42 404 AppX Deployment operation failed for package 588388d0-5c5f-41e1-8965-f8ed6a2644.Test.App_1.1.1.0_neutral_~_m042xdac27ax6 w
ith error 0x80073CF6. The specific error text for this failure is: error 0x80070005: Adding a tile failed with unexpected error.

任何帮助都非常感谢。我是认真的!任何,建议,解决方法,异教仪式, Crystal ,......

最佳答案

我遇到了完全相同的错误。我试图通过 Cygwin SSH 而不是 Powershell 远程进行安装,但我怀疑根本原因是相似的。

我能够通过设置一个计划任务来解决这个问题,该任务在一个众所周知的位置运行一个 Powershell 脚本。 (我使计划任务以尽可能高的权限运行,但我不确定是否有必要。)然后我可以远程设置此 Powershell 脚本的内容以运行应用程序安装脚本,然后使用schtasks ,这就像一个魅力。

关于powershell - 使用 powershell 远程处理安装 Windows 10 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34199280/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com