HowTo: Reverse RemoveStoreApps.ps1 in Citrix App Layering

citrix app layering restore appx RemoveStoreApps.ps1

Background and Context

Communicating a unique lesson from the field, reversing the RemoveStoreApps.ps1 script. Previous to Citrix App Layering 4.10, it was standard practice as part of Windows 10 optimizations to remove Windows Universal Apps. Citrix provides the RemoveStoreApps.ps1 script which performs the following:

  • Turn off Microsoft Consumer Experiences
  • Turn off Automatic Download and Install of updates for the Windows Store
  • Disable all apps from Windows Store
  • Turn off the Store Application
  • Remove All Windows Store bundled applications.

If we look at Citrix Consulting Architect Rob Zylowski’s blog from 2018 “Optimizing Windows and Citrix App Layering“, we see that it is recommended that removing Windows Universal Apps is performed on the OS Layer. The optimization is a significant one that is considered unreversible by Citrix Support.

The first OS Layer you create should be backed up and archived indefinitely, as the functionality of all subsequent layers created will be contingent on that initial OS Layer being encapsulated in your OS, Platform, and Application layers. Now the what ifs…

  • What if the RemoveStoreApps.ps1 script was run on your v1 OSLayer?
  • What if the v1 OSLayer has not been archived and is unrecoverable?
  • What if a new business requirement presents itself which requires the use of the Windows Store and Universal Apps?
  • What if you are in a pickle, and reversing the RemoveStoreApps.ps1 script will save you weeks of time compared to a rebuild of your App Layers?
  • What if… you get the picture…

As previously mentioned, as far as Citrix Support is concerned, the script is a permanent change that cannot be reversed with any supported method. Fortunately, I’ve recently been engaged with a customer where we’ve done just that, successfully re-enabled the Windows Store and Universal Apps on a Windows 10 multi-session OS Layer that was optimized with the RemoveStoreApps.ps1 script.

Target Audience

Citrix App Layering Aficionados… hello my people. Oh, and incidentally, I highly recommend that you register for Ferroque Systems’ upcoming Citrix App Layering Masterclass, taking place on August 17, 2022. The link to register/access the recording is below:

Register Here

During the Masterclass, Citrix Enterprise Architect Rob Zylowski and I will discuss; product and functional updates, lessons from the field, leading practices, and the App Layering roadmap. If you’re unfamiliar with Rob Zylowski, he is regarded as the technical authority on App Layering within Citrix. Of course, we’ll also save some time for Q&A from the audience as well.

If you miss it, the recording will eventually be available here.

The Road to Recovery

The actual process to make the universal apps available again is relatively straight forward requires only two PowerShell commands, and some manual intervention to ensure that applications actually update once the Windows store and the applications have been re-enabled.

Full disclosure, the process that ultimately re-enabled the Windows Store and Universal Apps I am bringing forward was initially outlined in a blog from a gentleman named Sergey Tkachenko in August 2015, Reinstall Windows Store in Windows 10 after Uninstalling it in PowerShell. Thank you for your contribution to the EUC community Sergey.

Firstly, the Windows Store must be reinstalled on your Windows 10 OS Layer via the following steps:

  • Open PowerShell as an Administrator
  • Run the following command in the Powershell console
    • Get-AppxPackage -allusers Microsoft.WindowsStore | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

Secondly, individual app packages can be re-added individually via the following steps:

  • Open PowerShell as an Administrator
  • Run the following command in the PowerShell console to restore applications that were previously removed and needs to be restored.
    • Get-AppXPackage -allusers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

Finally, applications should be updated from the Microsoft store before they are available again on the image. This can be accomplished by:

  • Selecting Start > Microsoft Store > Library > Get updates

If this maintenance is being performed on your OS Layer, you can finalize the image. I recommend you also make the change on your Platform Layer as well, otherwise, you’ll be required to repeat this process each time you update your existing Platform Layer’s VDA, Windows Patches, etc.

 

 

DISCLAIMER: THIS SOFTWARE OR SCRIPT IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x