いろいろやってみるにっき

てきとーに生きている奴の日記

古いエントリのサムネイル画像がリンク切れになってたりするけど、チマチマ修正中


Windows10にプリインストールされているが不要なソフトウェアをアンインストールするpowershell その3

続いて How To Run the Windows10SysPrepDebloater.ps1 file に進む。

 

shigeo-t.hatenablog.com

 

まずSysprepとは何かって話である。以前書いてた。Microsoftの説明は機械翻訳&技術者向けなのでわかりにくい。

shigeo-t.hatenablog.com

SysprepとはWindows OSのインストールを簡略化し、大量に展開するために利用されるツールである。元となるWindows OSシステムを1台用意して準備し、そのOSにSysprepを適用すると展開用のマスタ環境が用意できる。今回の場合のようにV2Vなどでクローニングすれば、システムのセットアップを簡単に済ませることができる上、インストールにかかる時間も短縮できる。いちいち各コンピュータにインストール用メディアをセットしてWindows OSをインストールする必要がなくなる。

 

一応Microsoftの説明。

docs.microsoft.com

 

では の説明を読んでみる。

WindowsSysPrepDebloater.ps1 ファイルには、使用する関数を指定できるように実行できるパラメーターがいくつかあります。パラメーターは、-SysPrep、-Debloat、および -Privacy です。 パラメータを指定してこれを実行するには、次の手順を実行します。

手順はダウンロードして(前回済んでる)、解凍して(前回済んでる)、当該ディレクトリに移動して、.\Windows10SysPrepDebloater.ps1 -Sysprep -Debloat -Privacy みたいに実行しろって書いてある。

 

そこで Sysprep, Interactive, and GUI Application に進む。

 現在、Windows10Debloater には 3 つのバージョンがあります。対話型バージョン、GUI アプリ バージョン、および純粋なサイレント バージョンがあります。

  • Windows10SysPrepDebloater.ps1 -> サイレント バージョンでは、スイッチ パラメーター -Sysprep、-Debloat -Privacy が使用されるようになりました。 サイレント バージョンは、MDT イメージの展開に役立ちます
  • Windows10Debloater.ps1 -> このインタラクティブ バージョンは、それが意味するものであり、インタラクティブ プロンプトを備えた Windows10Debloater スクリプトです。 これは、オプションのパラメーターを持つサイレント スクリプトを必要とする展開には使用しないでください。 このスクリプトは、スクリプトの実行内容を選択できるように、実行時にプロンプトで選択肢を提供します。
  • Windows10DebloaterGUI.ps1 -> Windows10DebloaterGUI.ps1 という名前の GUI アプリケーションがあり、スクリプトが実行するすべての機能を実行するためのボタンがあります。 これは、コードを操作したくない平均的なユーザーや、アプリケーション画面だけを見たい場合に適しています。

なるほど、前回までに動かしたWindows10Debloater.ps1、Windows10DebloaterGUI.ps1でもできそうだ。

 

続いて -Sysprep、-Debloat、 -Privacy パラメタの説明に進む。

Windows10SysPrepDebloater.ps1 スクリプトには、3 つのスイッチ パラメーターがあります。

  •  -SysPrep: get-appxpackage | get-appxpackage | 削除-appxpackage. 一部の管理者は、マシンが削除するアプリを適切にプロビジョニングできるようにするために、最初にそのコマンドを実行する必要があるため、これは便利です。
  • -Debloat、それが示唆するように行うパラメータを切り替えます。 次の関数を実行します: Start-Debloat、Remove-Keys、および Protect-Privacy。 Remove-Keys は、上記のブロートウェア アプリに関連付けられている残りのレジストリ キーを削除しますが、Start-Debloat 関数では削除されません。
  • -Privacy、一部のテレメトリ機能を停止するためのレジストリ キーの追加および/または変更、検索インデックスとしての Cortana の使用の停止、「不要な」スケジュール タスクの無効化など。

このスクリプトは、Remove-AppXPackage/Remove-AppXProvisionedPackage の使用時に Windows 10 からブロートウェアを削除し、事前に削除されていない特定のレジストリ キーを削除します。 最良の結果を得るには、ユーザー プロファイルを構成する前にこのスクリプトを実行する必要があります。そうしないと、削除する必要のあるアプリが残り、それらを削除すると、スタート メニューに壊れたタイルが表示される可能性があります。

 

うーん、訳してみたけどよくわからん。ということで前回と同じようにクリアされても困らないPCで実行してみる。

 

まずここまで準備できている。

PS C:\Users\shige\Downloads\Debloater> cd .\Debloater\
PS C:\Users\shige\Downloads\Debloater\Debloater> ls

    Directory: C:\Users\shige\Downloads\Debloater\Debloater

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----          2022/08/17    10:53                Individual Scripts
-a---          2022/08/17    10:53           1071 LICENSE
-a---          2022/08/17    10:53           9866 README.md
-a---          2022/08/17    10:53          46087 Windows10Debloater.ps1
-a---          2022/08/17    10:53          76621 Windows10DebloaterGUI.ps1
-a---          2022/08/17    10:53          13812 Windows10SysPrepDebloater.ps1

 

全部オプションありで実行する。プロンプト来た。ここはRだろう。

PS C:\Users\shige\Downloads\Debloater\Debloater> .\Windows10SysPrepDebloater.ps1 -Sysprep -Debloat -Privacy

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run C:\Users\shige\Downloads\Debloater\Debloater\Windows10SysPrepDebloater.ps1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"):

 

途中でエクスプローラーが立ち上がった。

 

そして正常終了したっぽい。

[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): R

Name           Used (GB)     Free (GB) Provider      Root                                               CurrentLocation
----           ---------     --------- --------      ----                                               ---------------
HKCR                                   Registry      HKEY_CLASSES_ROOT
Initiating Sysprep
Removing bloatware apps.
Get-AppxPackage: C:\Users\shige\Downloads\Debloater\Debloater\Windows10SysPrepDebloater.ps1:42
Line |
  42 |      Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $Whit|      ~~~~~~~~~~~~~~~
     | The 'Get-AppxPackage' command was found in the module 'Appx', but the module could not be loaded. For
     | more information, run 'Import-Module Appx'.

Get-AppxPackage: C:\Users\shige\Downloads\Debloater\Debloater\Windows10SysPrepDebloater.ps1:44
Line |
  44 |      Get-AppxPackage -AllUsers | Where-Object {$_.Name -NotMatch $Whit|      ~~~~~~~~~~~~~~~
     | The 'Get-AppxPackage' command was found in the module 'Appx', but the module could not be loaded. For
     | more information, run 'Import-Module Appx'.


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True


Path   :
Online : True

Removing leftover bloatware registry keys.
Removing HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y from registry
Removing HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0 from registry
Removing HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe from registry
Removing HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.BackgroundTasks\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.File\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0 from registry
Removing HKCR:\Extensions\ContractId\Windows.Launch\PackageId\46928bounde.EclipseManager_2.2.4.51_neutral__a5h4egax66k6y from registry
Removing HKCR:\Extensions\ContractId\Windows.Launch\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0 from registry
Removing HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.Launch\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.PreInstalledConfigTask\PackageId\Microsoft.MicrosoftOfficeHub_17.7909.7600.0_x64__8wekyb3d8bbwe from registry
Removing HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0 from registry
Removing HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.PPIProjection_10.0.15063.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.15063.0.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.Protocol\PackageId\Microsoft.XboxGameCallableUI_1000.16299.15.0_neutral_neutral_cw5n1h2txyewy from registry
Removing HKCR:\Extensions\ContractId\Windows.ShareTarget\PackageId\ActiproSoftwareLLC.562882FEEB491_2.6.18.18_neutral__24pqs290vpjk0 from registry
Checking to see if any Whitelisted Apps were removed, and if so re-adding them.
Get-AppxPackage: C:\Users\shige\Downloads\Debloater\Debloater\Windows10SysPrepDebloater.ps1:206
Line |
 206 |      If(!(Get-AppxPackage -AllUsers | Select Microsoft.Paint3D, Micros …
     |           ~~~~~~~~~~~~~~~
     | The 'Get-AppxPackage' command was found in the module 'Appx', but the module could not be loaded. For
     | more information, run 'Import-Module Appx'.

Stopping telemetry, disabling unneccessary scheduled tasks, and preventing bloatware from returning.
HKCR                                   Registry      HKEY_CLASSES_ROOT
Disabling Windows Feedback Experience program
VERBOSE: Performing the operation "Set Property" on target "Item: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo Property: Enabled".
Stopping Cortana from being used as part of your Windows Search Function
Stopping the Windows Feedback Experience program
Adding Registry key to prevent bloatware apps from returning
Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings
VERBOSE: Performing the operation "Set Property" on target "Item: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Holographic Property: FirstRunSucceeded".
Disabling live tiles
Turning off Data Collection
VERBOSE: Performing the operation "Set Property" on target "Item: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection Property: AllowTelemetry".
Disabling People icon on Taskbar
VERBOSE: Performing the operation "Set Property" on target "Item: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People Property: PeopleBand".
Disabling suggestions on the Start Menu
VERBOSE: Performing the operation "Set Property" on target "Item: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager Property: SystemPaneSuggestionsEnabled".
Removing CloudStore from registry if it exists
Remove-Item: C:\Users\shige\Downloads\Debloater\Debloater\Windows10SysPrepDebloater.ps1:180
Line |
 180 |       Remove-Item $CloudStore -Recurse -Force
     |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Attempted to perform an unauthorized operation.

この操作を正しく終了しました。
この操作を正しく終了しました。
Disabling scheduled tasks

Actions            : {MSFT_TaskExecAction}
Author             : Microsoft
Date               :
Description        : XblGameSave Standby Task
Documentation      :
Principal          : MSFT_TaskPrincipal2
SecurityDescriptor :
Settings           : MSFT_TaskSettings3
Source             :
State              : Disabled
TaskName           : XblGameSaveTask
TaskPath           : \Microsoft\XblGameSave\
Triggers           : {MSFT_TaskIdleTrigger}
URI                : \Microsoft\XblGameSave\XblGameSaveTask
Version            :
PSComputerName     :


Actions            : {MSFT_TaskExecAction}
Author             : Microsoft Corporation
Date               :
Description        : Windows カスタマー エクスペリエンス向上プログラムに参加する場合は、使用データが Microsoft へ送信さ
                     れます。
Documentation      :
Principal          : MSFT_TaskPrincipal2
SecurityDescriptor : D:(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;OICI;GRGX;;;AU)
Settings           : MSFT_TaskSettings3
Source             : Windows カスタマー エクスペリエンス向上プログラム
State              : Disabled
TaskName           : Consolidator
TaskPath           : \Microsoft\Windows\Customer Experience Improvement Program\
Triggers           : {MSFT_TaskTimeTrigger}
URI                : \Microsoft\Windows\Customer Experience Improvement Program\Consolidator
Version            : 1.0
PSComputerName     :


Actions            : {MSFT_TaskComHandlerAction}
Author             : Microsoft Corporation
Date               :
Description        : USB CEIP (カスタマー エクスペリエンス向上プログラム) タスクは、ご使用のコンピューターのユニバーサ
                     ル シリアル バス関連の統計情報を収集し、Microsoft の Windows Device Connectivity エンジニアリング
                     グループに送信します。送信された情報は、Windows における USB の信頼性、安定性、および全体的な機能
                     向上のために使用されます。ユーザーが Windows CEIP への参加に同意していない場合、このタスクは何も行
                     いません。
Documentation      :
Principal          : MSFT_TaskPrincipal2
SecurityDescriptor : D:(A;OICI;FA;;;BA)(A;OICI;FA;;;SY)(A;OICI;GRGX;;;AU)(A;OICI;SD;;;S-1-5-87-1060603329-121822201-345
                     2730971-4292368946-61207722)(A;;FRFX;;;LS)
Settings           : MSFT_TaskSettings3
Source             : Microsoft Corporation
State              : Disabled
TaskName           : UsbCeip
TaskPath           : \Microsoft\Windows\Customer Experience Improvement Program\
Triggers           :
URI                : \Microsoft\Windows\Customer Experience Improvement Program\UsbCeip
Version            : 1.0
PSComputerName     :


Actions            : {MSFT_TaskExecAction}
Author             : Microsoft Windows Feedback
Date               :
Description        : Update SIUF strings
Documentation      :
Principal          : MSFT_TaskPrincipal2
SecurityDescriptor :
Settings           : MSFT_TaskSettings3
Source             : System Initiated User Feedback
State              : Disabled
TaskName           : DmClient
TaskPath           : \Microsoft\Windows\Feedback\Siuf\
Triggers           :
URI                : \Microsoft\Windows\Feedback\Siuf\DmClient
Version            :
PSComputerName     :


Actions            : {MSFT_TaskExecAction}
Author             : Microsoft Windows Feedback
Date               :
Description        : Update SIUF strings
Documentation      :
Principal          : MSFT_TaskPrincipal2
SecurityDescriptor :
Settings           : MSFT_TaskSettings3
Source             : System Initiated User Feedback
State              : Disabled
TaskName           : DmClientOnScenarioDownload
TaskPath           : \Microsoft\Windows\Feedback\Siuf\
Triggers           : {MSFT_TaskTrigger}
URI                : \Microsoft\Windows\Feedback\Siuf\DmClientOnScenarioDownload
Version            :
PSComputerName     :

Finished all tasks.

 

結局よくわからない。Sysprepの機能を使っていらんもん消してるってことなのかな?

前回実行したGUI版だけ使えばいいのかも。リブートしてみる。ダウンロードアイコンだらけになってる。

確かに使わないアプリは消えたのかも。

 

で、ここまで実行して思い出したが実マシンじゃなくても使わないWindows 10のVMを持ってたんだった。

お時間あったら、他のエントリもクリックして頂ければ幸いです。