regarding a missing AppxPackage error on the last official Win 10 LTSC-Release I want to automatically install it in the post setup of Windows setup processing: Out of Box Experience (OOBE), the first boot UI. Therefore, I have the .appx file and put the following line in the SetupComplete.cmd:
powershell.exe -ExecutionPolicy bypass -Command "Add-AppxPackage %WINDIR%\Setup\Files\Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.appx" >> %WINDIR%\Setup\Files\log.txt
I am able to execute this line manually in a non-elevated PowerShell console but unfortunately, this is not working automatically within the Windows Setup processing as it says in the log (sorry, it is German):
Add-AppxPackage : Fehler bei Bereitstellung. HRESULT: 0x80073CF9,
Fehler bei der Installation. Wenden Sie sich an den
Softwarehersteller. (Ausnahme von HRESULT: 0x80073CF9) Der
Bereitstellungsvorgang Add fr das Paket
"Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe" von der
Installationsanforderung
"Microsoft.VCLibs.140.00_14.0.30704.0_x64__8wekyb3d8bbwe.appx" wurde
abgelehnt, da dieser Vorgang mit dem lokalen Systemkonto nicht
ausgefhrt werden darf. HINWEIS: Wenn Sie weitere Informationen
wnschen, suchen Sie im Ereignisprotokoll nach [ActivityId]
895ecdc3-eb9b-0002-0fcf-5e899bebd701, oder verwenden Sie die
Befehlszeile Get-AppxLog -ActivityID
895ecdc3-eb9b-0002-0fcf-5e899bebd701 In Zeile:1 Zeichen:1
Add-AppxPackage C:\Windows\Setup\Files\Microsoft.VCLibs.140.00_14.0.3 ...
+ CategoryInfo : WriteError: (C:\Windows\Setu...kyb3d8bbwe.appx:String) [Add-AppxPackage],
IOException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
Why is the local system account not able to install that package?
MSIX/AppX application packages are installed separately for each Windows user account - the app files are extracted to a central system location, but the registration of the app with the system has to be done for each user. I don't know why the Local System account is specifically banned from installing packages, but I can guess why that is so: it doesn't make sense for app packages to be installed for a user account that doesn't even represent a real person, let alone one that can login to the device.
If you'd like the package you're trying to install to be available to all users on the computer, you should "provision" the package using the Deployment Imaging and Servicing Manager (DISM). Provisioned packages will be installed automatically for all existing user accounts the next time they login, and for all newly created accounts on first login.
With DISM's /Add-ProvisionedAppXPackage subcommand (PowerShell version: Add-AppXProvisionedPackage), you can add a provisioned package to the running copy of Windows. I recommend you not do this in OOBE but earlier, in sysprep audit mode:
:: .bat or .cmd batch file would look like this:
Dism.exe -online -add-provisionedAppxPackage -packagePath:X:\whatever.appx
# PowerShell .ps1 script would look like this:
Add-AppXProvisionedPackage -Online -PackagePath X:\whatever.appx
You could also use DISM to provision the package in a Windows installation image (.WIM file) before Windows even gets installed on the device:
:: use Dism.exe -get-wiminfo to find the WIM's "index" number for the Windows edition or custom image you want to change
Dism.exe -mount-wim -wimFile:D:\sources\install.wim -index:1 -mountDir:X:\WimMount
Dism.exe -image:X:\WimMount -add-provisionedAppxPackage -packagePath:X:\whatever.appx
Dism.exe -unmount-wim -mountDir:X:\WimMount -commit
# use Get-WindowsImage to find the index for the image you want to change
Mount-WindowsImage -ImagePath D:\sources\install.wim -Index 1 -Path X:\WimMount
Add-AppXProvisionedPackage -Path X:\WimMount -PackagePath X:\whatever.appx
Dismount-WindowsImage -Path X:\WimMount -Save
Related
This is a common error that is not solved by the common solutions I have found on the internet.
Unable to run Get-PsRepository, Install-Module, and related (OneGet?) commands without them throwing the "Unable to find module providers (PowerShellGet)" error. This appears to be an issue with the NuGet packagemanager module but I do not know how to recover. The package provider installed appears valid
Symptom patterns:
C:> [Net.ServicePointManager]::SecurityProtocol
Tls12
Get-PSRepository
PackageManagement\Get-PackageSource : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4496 char:31
+ ... ckageSources = PackageManagement\Get-PackageSource #PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power...etPackageSource:GetPackageSource) [Get-PackageSource
], Exception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPackageSource
Register-PSRepository -Default -Verbose
VERBOSE: PowerShell meta provider initialization failed.
VERBOSE: No match was found for the specified search criteria and provider name 'PowerShellGet'. Try
'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.
PackageManagement\Register-PackageSource : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4211 char:17
+ ... $null = PackageManagement\Register-PackageSource #PSBoundParamete ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power...erPackageSource:RegisterPackageSource) [Register-Pac
kageSource], Exception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.RegisterPackageSource
Install-Module PowerShellGet -Force
PackageManagement\Install-Package : Unable to find module providers (PowerShellGet).
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21
+ ... $null = PackageManagement\Install-Package #PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception
+ FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage
Facts:
Windows 10 (1903)
Powershell 5.1.18362.1171
Running PowerShell as Administrator
Not behind a proxy
Have access to https://www.powershellgallery.com/api/v2
Have access to nuget.org
`[Net.ServicePointManager]::SecurityProtocol = Tls12
FIPS is disabled (HKLM\System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy\Enabled DWORD=0)
Get-PackageProvider shows only NuGet 2.8.5.208
PowerShellGet version is 1.0.0.1 ; when trying force a sxs install with Install-Module PowerShellGet -Force I get the same: PackageManagement\Install-Package : Unable to find module providers (PowerShellGet).
We encountered the same problem. Found this thread without a solution. But I dug a bit further and on the computer that had this problem we found version 1.4.7 of PackageManagement installed.
After removing this folder everything started working normally. I have not found how this thing got installed. Seems like a legit powershell module from Microsoft but it's interacting with the 'normal' PowershellGet module and seems to break it.
For us it was located in the %USERPROFILE%/documents/WindowsPowershell/Modules.
Also worth nothing that this %USERPROFILE% was a corporate OneDrive.
Edit: Microsoft have fixed this issue: https://github.com/PowerShell/vscode-powershell/issues/3432
Not enough Rep to comment.
I ended up in the same situation. A Windows 10 1909 machine, with
%USERPROFILE%/document being a corporate OneDrive. Moving
PackageManagement out of /WindowsPowerShell/ changed
Get-PSRepository's output from nothing to PSGallery. Thanks! – tmcg
Mar 1 at 21:35 This was exactly the same issue. I suspect this is
because PowerShell 7 dumped it into this location (possibly Visual
Studio Code when it prompt to update?) – aolszowka Mar 1 at 22:09
I encountered the same issue with packagemanagement in %USERPROFILE%/documents on my personal profile. The file dates matched when I installed VScode and the Powershell Extensions on this new machine.
Removing the folder from modules corrected the issue for the time being.
In addition to removing %USERPROFILE%/Documents/WindowsPowershell/Modules folder, I also found that putting the package manger locally helped powershell.exe -NoLogo -NoProfile -Command 'Save-Module PackageManagement -MinimumVersion 1.4.7 -LiteralPath ""C:\Program Files\WindowsPowerShell\Modules\""' thanks to itsho here https://github.com/PowerShell/vscode-powershell/issues/2824#issuecomment-750902181
The cause is due to the %USERPROFILE%/Documents folder being on a OneDrive and module-install keeps installing the PackageManagement module to user documents by default ignoring PSModulePath, even had the OneDrive location removed/changed.
This my module path from running PS inside vscode identifying info removed:
$env:PSModulePath -split ';'
C:\Users\{myUsername}\OneDrive - {myCompanyName}\{company}\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
There are more things that can be done to fix this from happening again discussed here https://github.com/PowerShell/PowerShell/issues/15552#issuecomment-1002708799
Like setting the documents folder to local and off OneDrive like shown here https://support.microsoft.com/en-us/topic/configuration-of-the-my-documents-folder-dfd9a90d-8f80-18d6-e7cc-f1566fc3b10b
I followed these steps for now.
In explorer to the left under quick access right click Documents, and then click Properties.
Change to the location tab in the configuration box and type the new path to the Documents folder, I used the local one
Click No so the existing files do not move and still can be accessed by going into OneDrive. I also added another quick access folder for my OneDrive location, but that is up to you.
Note: This effects other programs as well like the default save location for PowerPoint. You'll need to be mindful that you don't save something local thinking it will be backed up to OneDrive.
My module paths after the change:
$env:PSModulePath -split ';'
C:\Users\{myUsername}\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
Another workaround could be to have OneDrive keep the files local.
Navigate to %USERPROFILE%/Documents
Right click WindowsPowershell and select "Always keep on this device".
I haven't been able to test this one, but it might be the least impactful way to address this.
I do have a problem getting the MicrosoftTeams module loaded in PowerShell. I downloaded and imported the module with AllSigned authorization (no errors):
PS C:\WINDOWS\system32> Install-Module -Name MicrosoftTeams
PS C:\WINDOWS\system32> Import-Module MicrosoftTeams
Checking, whether the Module is loaded correctly, I also printed the available modules where it is displayed with the current version number:
PS C:\WINDOWS\system32> get-module -listavailable
Verzeichnis: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Script 1.0.1 Microsoft.PowerShell.Operation.V... {Get-OperationValidation, Invoke-OperationValidation}
Binary 1.1.4 MicrosoftTeams {Add-TeamUser, Connect-MicrosoftTeams, Disconnect-Microsof...
Binary 1.0.0.1 PackageManagement {Find-Package, Get-Package, Get-PackageProvider, Get-Packa...
Script 3.4.0 Pester {Describe, Context, It, Should...}
Script 1.0.0.1 PowerShellGet {Install-Module, Find-Module, Save-Module, Update-Module...}
Script 2.0.0 PSReadline {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remov...
Now, I wanted to connect to the Teams using the cmdlet Connect-MicrosoftTeams which is explicitly listed as one of the exported cmdlets in this imported module. But somehow, PowerShell does not find the command:
PS C:\WINDOWS\system32> Connect-MicrosoftTeams
Connect-MicrosoftTeams : Die Benennung "Connect-MicrosoftTeams" wurde nicht als Name eines Cmdlet, einer Funktion,
einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der
Pfad korrekt ist (sofern enthalten), und wiederholen Sie den Vorgang.
In Zeile:1 Zeichen:1
+ Connect-MicrosoftTeams
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-MicrosoftTeams:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
[Excuse the German: It reads: The name was not recognized as cmdlet or name of a function. But you probably know the message if you use PS]
Now, my question is: How can I get PS to recognize the command and how do I find out where the error lies? Is there a command to list the currently running scripts and available commands? Or is there a possibility to force the script to be executed?
I can see the output shows you have installed the module successfully. However, it seems to have some problem. I suggest you re-install it to see how it goes:
Run Windows PowerShell as an administrator
Run the command Uninstall-Module MicrosoftTeams,close PowerShell and re-open a new
elevated PowerShell session
Run the command Install-Module MicrosoftTeams,related doc.
https://learn.microsoft.com/en-us/microsoftteams/teams-powershell-install
After it is installed successfully,please Close PowerShell and re-open a new elevated PowerShell session as an administrator,run Connect-MicrosoftTeams again and see whether it works now. If the same issue persists,attach the screenshot of the entire output for further check.
I had to install the "Skype for Business Online, Windows PowerShell Module" to get Connect-MicrosoftTeams
https://www.microsoft.com/en-us/download/details.aspx?id=39366
While installing Visual Studio 2017 I encountered the error while downloading the JDKV2-Component for Xamarin (maybe someone could edit the English error message in?):
Paket "JavaJDKV2,version=1.8.2,chip=x86" konnte von "https://go.microsoft.com/fwlink/?linkid=863182" nicht heruntergeladen werden.
Such-URL
https://aka.ms/VSSetupErrorReports?q=PackageId=JavaJDKV2;PackageAction=DownloadPackage;ReturnCode=0x80072ee2
Details
WebClient-Download fehlgeschlagen: Timeout für Vorgang überschritten
Bits-Download fehlgeschlagen: Fehlerkontext: BG_ERROR_CONTEXT_REMOTE_FILE, Fehlercode: -2145844841
WinInet-Download fehlgeschlagen: Function: InternetOpenUrl, HR: -2147012894, Message: Unknown error 12002
Betroffene Workloads
Mobile-Entwicklung mit .NET (Microsoft.VisualStudio.Workload.NetCrossPlat,version=15.0.27128.1)
Mobile-Entwicklung mit C++ (Microsoft.VisualStudio.Workload.NativeMobile,version=15.0.27005.2)
Mobile-Entwicklung mit JavaScript (Microsoft.VisualStudio.Workload.WebCrossPlat,version=15.0.27019.1)
Betroffene Komponenten
Android SDK-Einrichtung (API-Ebene 23) (globale Installation) (Component.Android.SDK23,version=15.0.27128.1)
Android SDK-Setup (API-Ebene 19 und 21) (Component.Android.SDK19,version=15.0.27128.1)
Android SDK-Setup (API-Ebene 22) (Component.Android.SDK22,version=15.0.27128.1)
Google Android-Emulator (API-Ebene 23) (globale Installation) (Component.Google.Android.Emulator.API23.V2,version=15.0.27128.1)
Java SE Development Kit (8.0.1120.15) (Component.JavaJDK,version=15.0.26403.0)
Same for the x64-version of the JDK.
It turned out that the Oracle-Website needs a License-Accepted-cookie to download the files. While Microsoft seemingly tried to add it to the download routine it doesn't work for me and the installation won't proceed beyond the point where it tries to install the JDK.
So I downloaded the files manually. But where do I have to put them so that the Visual Studio installation knows that it won't need to download them again?
While searching the web for some hours I finally found the solution here:
https://developercommunity.visualstudio.com/content/problem/160625/packageidjavajdkv2packageactiondownloadpackageretu-5.html
Turns out you have to search for the following folder:
C:\ProgramData\Microsoft\VisualStudio\Packages
There you create a subfolder with the package name as written in the error message/error log (in my case "JavaJDKV2,version=1.8.2,chip=x86") and put the manually downloaded .exe file in there.
Restart the VS-installer and start the installation process.
I am trying to register the Windows 10 Edge package with Windows Server 2016. I have successfully installed the store thanks to a forum I found and it opens but remains untested. I am trying to do the same with Edge. I've copied the app package from the installer iso to C:\Windows\systemapps and ran the power shell script:
Add-AppxPackage -register "C:\windows\systemapps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\Appxmanifest.xml" -DisableDevelopmentMode
And get the following error:
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF9, Install failed. Please contact your software vendor.
(Exception from HRESULT: 0x80073CF9)
Rejecting a request to register from Appxmanifest.xml because the manifest is not in the package root.
NOTE: For additional information, look for [ActivityId] a80e1223-2787-0000-dc3e-12a98727d301 in the Event Log or use
the command line Get-AppxLog -ActivityID a80e1223-2787-0000-dc3e-12a98727d301
At line:1 char:1
+ Add-AppxPackage -register "C:\windows\systemapps\Microsoft.MicrosoftE ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (C:\windows\syst...ppxmanifest.xml:String) [Add-AppxPackage], IOException
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
I've verified the manifest is in the package root so other than that I can't figure out what it means. Can someone help me understand what it's looking for?
Reference for store install: http://virtualcustoms.net/showthread.php/72904-Install-Microsoft-Store-and-Apps-on-Windows-10-LTSB-2016
I was just trying to do the same thing and I have found if I copy the app to C:\Program Files\WindowsApps then it installs without complaining about not being in the root and then the Edge icon also appears on the start menu.
The command to run is:
Add-AppxPackage -DisableDevelopmentMode -Register "C:\Program Files\WindowsApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AppxManifest.xml"
Whilst this allows the app to install and I am able to launch it from the start menu it closes after about 2 seconds and looking in the log (Application and Service Logs\Microsoft\Windows\Apps\Microsoft-Windows-TWinUI/Operational it shows this error so it looks like there is still something else that needs to be done to get this working:
ActivateApplicationForContractByAppIdAsUserWithHost of the app Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge for the Windows.Launch contract failed with The app didn't start..
Robin
I found it difficult to add to the win apps folder but figured out as long as the location of the apps you want to add are located in a folder named C:\Program Files\WindowsApps* it will work. I use a folder named “WindowsApps-Import” in the programs folder, works well!
One answer suggests adding the -DisableDevelopmentMode flag to the command you've ran, which works, but leaves an important point out.
Once the app installs, it won't run and crashes soon after. This is because the ALL APPLICATION PACKAGES group doesn't have access to the folder of the app. Giving ALL APPLICATION PACKAGES full control of the app folder will allow it to run.
Move the folder inside: "C:\Users$USERNAME\AppData\Local\Packages" then it works. Obv developer mode on windows needs to be ON.
for eg:
Add-AppxPackage -Register "C:\Users\Amit\AppData\Local\Packages\WsaPackage_1.7.32815.0_x64_Release-Nightly\AppxManifest.xml"
when I try to open a project in VS 2015 I get the error "Access denied" on a File located in C:\Users\XY\AppData\Roaming\Microsoft\VisualStudio\14.0\FeedCache .
The german message is "C:\Users\XY\Documents\Visual Studio 2015\Projects\App1\App1\App1.csproj : error : Der Zugriff auf den Pfad "C:\Users\XY\AppData\Roaming\Microsoft\VisualStudio\14.0\FeedCache\Feed-969FF52C4894C164-File.xml" wurde verweigert."
Some hours ago I restarted my computer for system updates and immediately after that I installed the english language pack for VS.
So I navigated to that FeedCache folder. For that Folder I have all permissions an the security settings grant me al privileges even for inherited files and folders (screenshot). But when i, for example, try to rename a file inside that FeedCache folder, I get a access denied Message. So for me it seems to be a matter of wrong previlegs.
I've tried to disable Inheritance for the FeedCache Folder and the to re-enable it. But I get an error during enableing (screenshot).
Kim