PowerShell / PowerShell

PowerShell for every system!
https://microsoft.com/PowerShell
MIT License
43.56k stars 7.06k forks source link

Microsoft update moves PowerShell's install location without prompting #21526

Closed yihuajack closed 3 weeks ago

yihuajack commented 3 weeks ago

Prerequisites

Steps to reproduce

  1. Install PowerShell to a custom directory (for example, D:\Program Files\PowerShell\7\pwsh.exe)
  2. Windows update automatically updates PowerShell

Expected behavior

The Windows update should update PowerShell in place, i.e., still under D:\Program Files.

Actual behavior

The Windows update automatically uninstalls the older version of PowerShell under D:\Program Files and automatically installs the new version of PowerShell under C:\Program Files without prompting anything. The result is that Terminal 1.19.10821.0 cannot find PowerShell, unless users change the configuration (error 2147942402 (0x80070002)).

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

OS Data

Version    Caption
-------    -------
10.0.22631 Microsoft Windows 11 家庭中文版

Windows update log

Getting the list of all ETL files...

Please wait for all of conversions to complete...

================ Results from WULog_0 ================\DELL… [12/12 Complete:                                       ]

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.4.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.5.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.6.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.7.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.8.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.9.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.10.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00000
警告:
某些事件与架构不匹配。
请使用 -lr 重新运行此命令以得到较少限制的 XML 转储
命令成功结束。

==================================================

================ Results from WULog_1 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.11.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.12.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.13.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.14.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.15.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.16.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.17.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.18.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.19.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240416.201906.785.20.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00001
警告:
某些事件与架构不匹配。
请使用 -lr 重新运行此命令以得到较少限制的 XML 转储
命令成功结束。

==================================================

================ Results from WULog_2 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.015721.625.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.015721.625.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.031900.000.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.031900.000.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.031900.000.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.031900.000.4.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.034144.497.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.034144.497.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.150127.287.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.153553.587.1.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00002
命令成功结束。

==================================================

================ Results from WULog_3 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.153553.587.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.153553.587.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.155600.557.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.172536.158.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.174116.815.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.174116.815.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.195722.564.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.203657.738.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.212302.542.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240417.220824.969.1.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00003
命令成功结束。

==================================================

================ Results from WULog_4 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.4.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.5.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.6.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.7.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.8.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.9.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.10.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00004
命令成功结束。

==================================================

================ Results from WULog_5 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.11.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.12.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.13.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.14.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.15.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.16.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.022923.747.17.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.112616.519.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.121020.522.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.135138.558.1.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00005
命令成功结束。

==================================================

================ Results from WULog_6 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.193647.741.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.231531.667.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240418.231531.667.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.015421.707.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.015421.707.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.015421.707.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.015421.707.4.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.015421.707.5.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.015421.707.6.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.015421.707.7.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00006
命令成功结束。

==================================================

================ Results from WULog_7 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.022100.613.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.105019.203.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.105019.203.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.113743.063.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.113743.063.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.113743.063.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.130235.828.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.130235.828.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.142358.074.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.181921.172.1.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00007
命令成功结束。

==================================================

================ Results from WULog_8 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.181921.172.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.212307.858.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.214702.014.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240419.224749.529.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.001213.701.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.005247.556.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.005247.556.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.005247.556.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.020955.940.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.020955.940.2.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00008
命令成功结束。

==================================================

================ Results from WULog_9 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.020955.940.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.020955.940.4.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.021224.494.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.021224.494.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.112748.485.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.112748.485.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.131151.888.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.131151.888.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.131151.888.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.150228.524.1.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00009
命令成功结束。

==================================================

================ Results from WULog_10 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.150228.524.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.201251.918.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240420.205116.439.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.024803.571.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.024803.571.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.110755.719.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.112243.414.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.112243.414.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.142939.584.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.142939.584.2.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00010
命令成功结束。

==================================================

================ Results from WULog_11 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.145732.556.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.145732.556.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.145732.556.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.171635.982.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240421.211510.622.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.132001.229.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.134527.332.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.134527.332.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.134527.332.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.134527.332.4.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00011
命令成功结束。

==================================================

================ Results from WULog_12 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.134527.332.5.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.134527.332.6.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.163123.672.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.163123.672.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.163123.672.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.211758.101.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240422.211758.101.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.003012.993.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.003012.993.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.003012.993.3.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00012
命令成功结束。

==================================================

================ Results from WULog_13 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.120228.068.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.123655.314.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.123655.314.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.123655.314.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.123655.314.4.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.123655.314.5.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.123655.314.6.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.162351.356.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.214740.292.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.214740.292.2.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00013
命令成功结束。

==================================================

================ Results from WULog_14 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.214740.292.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240423.234325.649.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.4.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.5.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.6.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.7.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.8.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00014
命令成功结束。

==================================================

================ Results from WULog_15 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.9.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.10.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.11.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.12.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.13.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.14.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.15.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.16.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.17.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.18.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00015
命令成功结束。

==================================================

================ Results from WULog_16 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.19.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.20.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.21.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.22.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.23.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.24.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.035514.888.25.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.104800.291.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.104800.291.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.104800.291.3.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00016
命令成功结束。

==================================================

================ Results from WULog_17 ================

输入
----------------
文件:
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.134212.287.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.134212.287.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.134212.287.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.134212.287.4.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.134212.287.5.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.134212.287.6.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.144340.492.1.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.144340.492.2.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.144340.492.3.etl
     C:\Windows\Logs\WindowsUpdate\WindowsUpdate.20240424.144340.492.4.etl

100.00%

输出
----------------
转储文件:        C:\Users\DELL\AppData\Local\Temp\WindowsUpdateLog\wuetl.XML.tmp.9ffd3223-e52a-4760-90c7-7ac88da4ce61.00017
命令成功结束。

==================================================

WindowsUpdate.log written to C:\Users\DELL\Desktop\WindowsUpdate.log

Visuals

No response

kilasuit commented 3 weeks ago

I'm 90% certain this has been raised before - let me try find the issue

kilasuit commented 3 weeks ago

dupe of #17490

Currently as per [this comment] (https://github.com/PowerShell/PowerShell/issues/17490#issuecomment-1149114712) this seems this is by design not possible

Personally, whilst not ideal, if you want a custom install location and to update regularly then Id make use of methods using the Install-PowerShell script & a scheduled task like I've blogged about in this Installing PowerShell Side by Side for testing purposes particularly as it there is a delay between a release and it being available via Microsoft Update & other places like WinGet etc

microsoft-github-policy-service[bot] commented 3 weeks ago

This issue has been marked as duplicate and has not had any activity for 1 day. It has been closed for housekeeping purposes.

microsoft-github-policy-service[bot] commented 3 weeks ago

📣 Hey @yihuajack, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

Microsoft Forms