Deploy Powershell script ?


  • Our Windows 10 machines the logins can take up to 2 minutes. I've found that if I run the below commands to remove some of the built in apps the logins are significantly faster. My question is is there any way of deploying this to many computers. I've tried it as a Group Policy both startup and login script it doesn't run. We have too many machines for me to go to each open powershell as admin etc. Is there a goo way of deploying something like this?
    # Description:
    # This script removes unwanted Apps that come with Windows. If you do not want
    # to remove certain Apps comment out the corresponding lines below.
    Import-Module -DisableNameChecking $PSScriptRoot\..\lib\take-own.psm1
    echo "Elevating priviledges for this process"
    do {} until (Elevate-Privileges SeTakeOwnershipPrivilege)
    echo "Uninstalling default apps"
    $apps = @(
    # default Windows 10 apps
    # Threshold 2 apps
    #Redstone apps
    # non-Microsoft
    # apps which cannot be removed using Remove-AppxPackage
    foreach ($app in $apps) {
    echo "Trying to remove $app"
    Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage
    Get-AppXProvisionedPackage -Online |
    where DisplayName -EQ $app |
    Remove-AppxProvisionedPackage -Online


    Friday, October 21, 2016 7:05 PM


All replies