mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-07-01 16:09:46 +02:00
Compare commits
143 Commits
dev/snickl
...
autoUpgrad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
df1d6ea7e0 | ||
|
|
31e30280de | ||
|
|
5074588c9a | ||
|
|
df7a41b457 | ||
|
|
b0b073f088 | ||
|
|
c56258d2d3 | ||
|
|
236c241107 | ||
|
|
d6f61c8439 | ||
|
|
b387bbffdd | ||
|
|
5003c6c758 | ||
|
|
b2ef4c85bc | ||
|
|
24d56f0524 | ||
|
|
0089de33bd | ||
|
|
3e2914a0b2 | ||
|
|
3554f0884b | ||
|
|
ad60090096 | ||
|
|
de6a609d16 | ||
|
|
243255ecea | ||
|
|
1e1bd07087 | ||
|
|
32b4080007 | ||
|
|
47c1fb5418 | ||
|
|
8ee3d64667 | ||
|
|
51c9bc4930 | ||
|
|
ddff66c088 | ||
|
|
e28ed8a566 | ||
|
|
4f693778f2 | ||
|
|
e1ad13ab34 | ||
|
|
cea0497bb9 | ||
|
|
fd5be6d04e | ||
|
|
4dfdf46e0d | ||
|
|
1c4ecc23c6 | ||
|
|
5888f6eb7f | ||
|
|
152f64151b | ||
|
|
76b773b016 | ||
|
|
0da5602f68 | ||
|
|
565094abbe | ||
|
|
1314f68602 | ||
|
|
fbad0dce9c | ||
|
|
36a5b77e6c | ||
|
|
4ce451edd0 | ||
|
|
42924e71c7 | ||
|
|
addebb8126 | ||
|
|
3b6453c932 | ||
|
|
2c97e04019 | ||
|
|
d27594c4f7 | ||
|
|
ac28b1c29f | ||
|
|
ee70b3ceca | ||
|
|
7cc4a16aa7 | ||
|
|
8c8c99c382 | ||
|
|
feae285c40 | ||
|
|
c34fb7f953 | ||
|
|
7d171a4428 | ||
|
|
2d037c4e91 | ||
|
|
0a69c93b87 | ||
|
|
a022a9f024 | ||
|
|
0b7d780980 | ||
|
|
7685cd1226 | ||
|
|
72bdfb073b | ||
|
|
96f97064be | ||
|
|
75a0fe1d2f | ||
|
|
5792d32d32 | ||
|
|
4cb3359314 | ||
|
|
943c2a1ff5 | ||
|
|
f686155d9b | ||
|
|
9afa1ec71d | ||
|
|
4337f8e5ff | ||
|
|
ed47bceac2 | ||
|
|
df23546c0b | ||
|
|
25f44bc6d9 | ||
|
|
dc533fbdb3 | ||
|
|
c05ba4e2c8 | ||
|
|
c83dd972a0 | ||
|
|
c33053b26b | ||
|
|
2cf7d0f5ec | ||
|
|
7cb0f3861a | ||
|
|
1106ac61f5 | ||
|
|
107bf3882c | ||
|
|
3f35b11cee | ||
|
|
1a9fcdcd1f | ||
|
|
6cf1d32e5a | ||
|
|
33497e59cc | ||
|
|
3d2f069c43 | ||
|
|
79d9b0e667 | ||
|
|
e2f611a7fc | ||
|
|
84ce86c573 | ||
|
|
735ea01a93 | ||
|
|
93f80f5f61 | ||
|
|
21f06b8bd0 | ||
|
|
fa78cc8ea7 | ||
|
|
cb9d54317a | ||
|
|
5d0eabed15 | ||
|
|
7051b8939b | ||
|
|
0d41d45a64 | ||
|
|
86115a54f6 | ||
|
|
99706d4324 | ||
|
|
ff194c0b5f | ||
|
|
a151d6c8b6 | ||
|
|
7610b77109 | ||
|
|
549b32e273 | ||
|
|
0ccf5986e9 | ||
|
|
87b24afa23 | ||
|
|
74c53c14e6 | ||
|
|
77173cd075 | ||
|
|
149e7b1efe | ||
|
|
0c2d24c3f6 | ||
|
|
b81ea23c68 | ||
|
|
39bbf0593e | ||
|
|
4620f6f381 | ||
|
|
da3b12d536 | ||
|
|
bab77edd11 | ||
|
|
414ee86fb3 | ||
|
|
eeeb6c0c93 | ||
|
|
70e082ce4f | ||
|
|
8404bfbebb | ||
|
|
77412d1961 | ||
|
|
fad5a3ac69 | ||
|
|
52cab7058a | ||
|
|
35a3c55f29 | ||
|
|
ed16ae7b2a | ||
|
|
f049cc5839 | ||
|
|
f82fb2a411 | ||
|
|
90131e35d9 | ||
|
|
77355ef2fb | ||
|
|
a130969d0a | ||
|
|
d1605640ca | ||
|
|
9859fb6196 | ||
|
|
3bd85efc56 | ||
|
|
f8453214fb | ||
|
|
0aca7c292c | ||
|
|
c6f1a09fa2 | ||
|
|
b72224ea0b | ||
|
|
e323da939b | ||
|
|
75fb296bb2 | ||
|
|
3d69785ca4 | ||
|
|
f6b0996c9b | ||
|
|
748d5e485c | ||
|
|
1718cecedb | ||
|
|
4f0c8f476a | ||
|
|
a953a39aec | ||
|
|
8c4ff37a50 | ||
|
|
02062dd023 | ||
|
|
bcbca0d5dd | ||
|
|
f0134e4448 |
9
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
9
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -40,7 +40,6 @@ body:
|
||||
- Other (please specify in "Steps to Reproduce")
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Area(s) with issue?
|
||||
@@ -106,7 +105,13 @@ body:
|
||||
placeholder: What happened instead?
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: upload
|
||||
id: bugreportfile
|
||||
attributes:
|
||||
label: Upload Bug Report ZIP-file
|
||||
description: Right-clicking the PowerToys tray icon in the taskbar and selecting “Report bug” generates a ZIP file containing diagnostic information about your setup and PowerToys logs, helping us better understand and troubleshoot the issue.
|
||||
validations:
|
||||
required: false
|
||||
- id: additionalInfo
|
||||
type: textarea
|
||||
attributes:
|
||||
|
||||
30
.github/actions/spell-check/allow/code.txt
vendored
30
.github/actions/spell-check/allow/code.txt
vendored
@@ -1,6 +1,7 @@
|
||||
# COLORS
|
||||
|
||||
argb
|
||||
Bgr
|
||||
bgra
|
||||
BLACKONWHITE
|
||||
BLUEGRAY
|
||||
@@ -18,6 +19,7 @@ OLIVEGREEN
|
||||
PALEBLUE
|
||||
PArgb
|
||||
Pbgra
|
||||
SRGBTo
|
||||
WHITEONBLACK
|
||||
|
||||
|
||||
@@ -28,6 +30,7 @@ RUS
|
||||
|
||||
AYUV
|
||||
bak
|
||||
HDP
|
||||
Bcl
|
||||
bgcode
|
||||
Deflatealgorithm
|
||||
@@ -297,6 +300,8 @@ pwa
|
||||
|
||||
AOT
|
||||
Aot
|
||||
ify
|
||||
TFM
|
||||
|
||||
# YML
|
||||
onefuzz
|
||||
@@ -327,6 +332,7 @@ REGSTR
|
||||
INVOKEIDLIST
|
||||
MEMORYSTATUSEX
|
||||
ABE
|
||||
Mdt
|
||||
HTCAPTION
|
||||
POSCHANGED
|
||||
QUERYPOS
|
||||
@@ -334,6 +340,30 @@ SETAUTOHIDEBAR
|
||||
WINDOWPOS
|
||||
WINEVENTPROC
|
||||
WORKERW
|
||||
FULLSCREENAPP
|
||||
|
||||
# COM/WinRT interface prefixes and type fragments
|
||||
BAlt
|
||||
BShift
|
||||
Cmanifest
|
||||
Cmodule
|
||||
Cuuid
|
||||
Dng
|
||||
IApplication
|
||||
IDisposable
|
||||
IEnum
|
||||
IFolder
|
||||
IInitialize
|
||||
IMemory
|
||||
IOle
|
||||
ipreview
|
||||
IProperty
|
||||
IShell
|
||||
ithumbnail
|
||||
IVirtual
|
||||
|
||||
# Test frameworks
|
||||
MSTEST
|
||||
|
||||
# PowerRename metadata pattern abbreviations (used in tests and regex patterns)
|
||||
DDDD
|
||||
|
||||
3
.github/actions/spell-check/allow/names.txt
vendored
3
.github/actions/spell-check/allow/names.txt
vendored
@@ -178,7 +178,9 @@ Taras
|
||||
TBM
|
||||
Teutsch
|
||||
tilovell
|
||||
traies
|
||||
Triet
|
||||
udit
|
||||
urnotdfs
|
||||
vednig
|
||||
waaverecords
|
||||
@@ -223,6 +225,7 @@ Moq
|
||||
mozilla
|
||||
mspaint
|
||||
Newtonsoft
|
||||
NVIDIA
|
||||
onenote
|
||||
openai
|
||||
Quickime
|
||||
|
||||
124
.github/actions/spell-check/allow/zoomit.txt
vendored
124
.github/actions/spell-check/allow/zoomit.txt
vendored
@@ -1,9 +1,23 @@
|
||||
accelscroll
|
||||
acq
|
||||
adr
|
||||
Adr
|
||||
APPLYTOSUBMENUS
|
||||
AUDCLNT
|
||||
axisdefer
|
||||
axisflip
|
||||
axisstart
|
||||
bitmaps
|
||||
BREAKSCR
|
||||
BUFFERFLAGS
|
||||
Cands
|
||||
capturepath
|
||||
centiseconds
|
||||
CLASSW
|
||||
coeffs
|
||||
coprime
|
||||
CREATEDIBSECTION
|
||||
crossfades
|
||||
Ctl
|
||||
CTLCOLOR
|
||||
CTLCOLORBTN
|
||||
@@ -11,53 +25,163 @@ CTLCOLORDLG
|
||||
CTLCOLOREDIT
|
||||
CTLCOLORLISTBOX
|
||||
CTrim
|
||||
ddy
|
||||
DFCS
|
||||
dlg
|
||||
dlu
|
||||
DONTCARE
|
||||
downsample
|
||||
DRAWITEM
|
||||
DRAWITEMSTRUCT
|
||||
droppedband
|
||||
Droppedband
|
||||
dsum
|
||||
dupburst
|
||||
dupsegments
|
||||
DWLP
|
||||
EDITCONTROL
|
||||
ENABLEHOOK
|
||||
expectedlock
|
||||
fastscroll
|
||||
FDE
|
||||
GETCHANNELRECT
|
||||
GETCHECK
|
||||
GETSCREENSAVEACTIVE
|
||||
GETSCREENSAVETIMEOUT
|
||||
GETTHUMBRECT
|
||||
GIFs
|
||||
hcfdark
|
||||
hcfwhitespace
|
||||
HTBOTTOMRIGHT
|
||||
HTHEME
|
||||
htol
|
||||
ICONINFORMATION
|
||||
ICONWARNING
|
||||
Inj
|
||||
jumprecover
|
||||
KSDATAFORMAT
|
||||
latestcapture
|
||||
ldx
|
||||
LEFTNOWORDWRAP
|
||||
legitjumps
|
||||
letterbox
|
||||
lld
|
||||
llu
|
||||
llums
|
||||
logfont
|
||||
lookback
|
||||
lround
|
||||
lte
|
||||
luma
|
||||
Luma
|
||||
manualdrop
|
||||
maskcache
|
||||
maxstep
|
||||
MENUINFO
|
||||
mic
|
||||
middledrop
|
||||
middledrop
|
||||
MMRESULT
|
||||
momentumreversal
|
||||
mrate
|
||||
mrt
|
||||
narrowstrip
|
||||
ncapture
|
||||
ncm
|
||||
nduplicates
|
||||
niterations
|
||||
nmonitor
|
||||
NONCLIENTMETRICS
|
||||
nonvle
|
||||
nredraw
|
||||
nstop
|
||||
nsubpixel
|
||||
ntorn
|
||||
nvw
|
||||
osc
|
||||
OWNERDRAW
|
||||
PBGRA
|
||||
periodictrap
|
||||
pfdc
|
||||
playhead
|
||||
pointerreuse
|
||||
pwfx
|
||||
Qpc
|
||||
quantums
|
||||
RCZOOMITSCR
|
||||
realcapture
|
||||
REFKNOWNFOLDERID
|
||||
reposted
|
||||
SCREENSAVE
|
||||
SCRNSAVE
|
||||
SCRNSAVECONFIGURE
|
||||
scrnsavw
|
||||
Scrnsavw
|
||||
scrollramp
|
||||
SCROLLSIZEGRIP
|
||||
selftest
|
||||
SETBARCOLOR
|
||||
SETBKCOLOR
|
||||
SETDEFID
|
||||
SETRECT
|
||||
SETSCREENSAVETIMEOUT
|
||||
SHAREMODE
|
||||
SHAREVIOLATION
|
||||
shortlist
|
||||
slowthenfast
|
||||
smallstart
|
||||
SNIPOCR
|
||||
ssi
|
||||
startuprecovery
|
||||
stf
|
||||
stopafter
|
||||
STREAMFLAGS
|
||||
submix
|
||||
sxx
|
||||
sxy
|
||||
syy
|
||||
tallportal
|
||||
tci
|
||||
tcsicmp
|
||||
TEXTMETRIC
|
||||
tinystep
|
||||
tme
|
||||
toolbars
|
||||
TRACKMOUSEEVENT
|
||||
Unadvise
|
||||
vaddq
|
||||
vaddvq
|
||||
vandq
|
||||
vcgeq
|
||||
vdup
|
||||
vld
|
||||
vle
|
||||
Vle
|
||||
VLE
|
||||
vminq
|
||||
vmlal
|
||||
vmull
|
||||
vqaddq
|
||||
vshrn
|
||||
vsntprintf
|
||||
vsnwprintf
|
||||
vsync
|
||||
WASAPI
|
||||
WAVEFORMATEX
|
||||
WAVEFORMATEXTENSIBLE
|
||||
wfopen
|
||||
wideportal
|
||||
wil
|
||||
WMU
|
||||
wrapjump
|
||||
wtol
|
||||
WTSSESSION
|
||||
WTSUn
|
||||
XEnd
|
||||
XStart
|
||||
XStep
|
||||
YInternal
|
||||
ZMBS
|
||||
zncc
|
||||
Zncc
|
||||
ZNCC
|
||||
|
||||
2
.github/actions/spell-check/excludes.txt
vendored
2
.github/actions/spell-check/excludes.txt
vendored
@@ -140,8 +140,6 @@
|
||||
^tools/project_template/ModuleTemplate/resource\.h$
|
||||
^tools/Verification scripts/Check preview handler registration\.ps1$
|
||||
ignore$
|
||||
^src/modules/registrypreview/RegistryPreviewUILib/Controls/HexBox/.*$
|
||||
^src/common/CalculatorEngineCommon/exprtk\.hpp$
|
||||
src/modules/cmdpal/ext/SamplePagesExtension/Pages/SampleMarkdownImagesPage.cs
|
||||
^src/modules/powerrename/unittests/testdata/avif_test\.avif$
|
||||
^src/modules/powerrename/unittests/testdata/heif_test\.heic$
|
||||
|
||||
116
.github/actions/spell-check/expect.txt
vendored
116
.github/actions/spell-check/expect.txt
vendored
@@ -16,6 +16,7 @@ adaptivecards
|
||||
ADDSTRING
|
||||
ADDUNDORECORD
|
||||
ADifferent
|
||||
ADMINS
|
||||
adml
|
||||
admx
|
||||
advfirewall
|
||||
@@ -34,6 +35,7 @@ Allman
|
||||
ALLOWUNDO
|
||||
ALLVIEW
|
||||
ALPHATYPE
|
||||
altkey
|
||||
AModifier
|
||||
amr
|
||||
ANDSCANS
|
||||
@@ -51,6 +53,7 @@ Apm
|
||||
APPBARDATA
|
||||
APPEXECLINK
|
||||
APPLICATIONFRAMEHOST
|
||||
apphost
|
||||
appmanifest
|
||||
APPMODEL
|
||||
APPNAME
|
||||
@@ -84,6 +87,7 @@ AUTOCHECKBOX
|
||||
AUTOHIDE
|
||||
AUTOHSCROLL
|
||||
AUTOMATIONPROPERTIES
|
||||
autopf
|
||||
AUTORADIOBUTTON
|
||||
Autorun
|
||||
AUTOTICKS
|
||||
@@ -129,6 +133,7 @@ bthprops
|
||||
bti
|
||||
BTNFACE
|
||||
bugreport
|
||||
bugreportfile
|
||||
BUILDARCH
|
||||
BUILDNUMBER
|
||||
buildtransitive
|
||||
@@ -168,7 +173,11 @@ cim
|
||||
CImage
|
||||
cla
|
||||
CLASSDC
|
||||
classguid
|
||||
classmethod
|
||||
CLASSNOTAVAILABLE
|
||||
claude
|
||||
CLEARTYPE
|
||||
clickable
|
||||
clickonce
|
||||
clientside
|
||||
@@ -200,6 +209,7 @@ colorformat
|
||||
colorhistory
|
||||
colorhistorylimit
|
||||
COLORKEY
|
||||
colorref
|
||||
comctl
|
||||
comdlg
|
||||
comexp
|
||||
@@ -217,6 +227,8 @@ CONTEXTHELP
|
||||
CONTEXTMENUHANDLER
|
||||
contractversion
|
||||
CONTROLPARENT
|
||||
Convs
|
||||
cooldown
|
||||
copiedcolorrepresentation
|
||||
COPYPEN
|
||||
COREWINDOW
|
||||
@@ -227,7 +239,10 @@ cpcontrols
|
||||
cph
|
||||
cplusplus
|
||||
CPower
|
||||
cpptools
|
||||
cppvsdbg
|
||||
cppwinrt
|
||||
createallsubdirs
|
||||
createdump
|
||||
CREATEPROCESS
|
||||
CREATESCHEDULEDTASK
|
||||
@@ -249,6 +264,8 @@ CTLCOLORSTATIC
|
||||
CURRENTDIR
|
||||
CURSORINFO
|
||||
cursorpos
|
||||
CURSORSHOWING
|
||||
cursorwrap
|
||||
customaction
|
||||
CUSTOMACTIONTEST
|
||||
CVal
|
||||
@@ -262,15 +279,18 @@ CYSMICON
|
||||
CYVIRTUALSCREEN
|
||||
Dac
|
||||
dacl
|
||||
DArchitectures
|
||||
datareader
|
||||
datatracker
|
||||
Dayof
|
||||
dbcc
|
||||
DBID
|
||||
DBLCLKS
|
||||
DBLEPSILON
|
||||
DBPROP
|
||||
DBPROPIDSET
|
||||
DBPROPSET
|
||||
DBT
|
||||
DCBA
|
||||
DCOM
|
||||
DComposition
|
||||
@@ -286,6 +306,8 @@ DEFAULTFLAGS
|
||||
DEFAULTICON
|
||||
defaultlib
|
||||
DEFAULTONLY
|
||||
DEFAULTSIZE
|
||||
defaulttonearest
|
||||
DEFAULTTONULL
|
||||
DEFAULTTOPRIMARY
|
||||
DEFERERASE
|
||||
@@ -305,11 +327,21 @@ DESKTOPABSOLUTEPARSING
|
||||
desktopshorcutinstalled
|
||||
devblogs
|
||||
devdocs
|
||||
devenv
|
||||
DEVICEINTERFACE
|
||||
devicetype
|
||||
DEVINTERFACE
|
||||
devmgmt
|
||||
DEVMODE
|
||||
DEVMODEW
|
||||
DEVNODES
|
||||
devpal
|
||||
DEVTYP
|
||||
dfx
|
||||
DIALOGEX
|
||||
diffs
|
||||
digicert
|
||||
DINORMAL
|
||||
DISABLEASACTIONKEY
|
||||
DISABLENOSCROLL
|
||||
diskmgmt
|
||||
@@ -324,6 +356,7 @@ dlib
|
||||
dllhost
|
||||
dllmain
|
||||
Dmdo
|
||||
DMy
|
||||
DNLEN
|
||||
DONOTROUND
|
||||
DONTVALIDATEPATH
|
||||
@@ -423,6 +456,15 @@ eyetracker
|
||||
FANCYZONESDRAWLAYOUTTEST
|
||||
FANCYZONESEDITOR
|
||||
FARPROC
|
||||
fdw
|
||||
fdx
|
||||
FErase
|
||||
fesf
|
||||
FFFF
|
||||
fffffffzzz
|
||||
FInc
|
||||
FFh
|
||||
Figma
|
||||
FILEEXPLORER
|
||||
FILEFLAGS
|
||||
FILEFLAGSMASK
|
||||
@@ -434,11 +476,13 @@ FILEMUSTEXIST
|
||||
FILEOP
|
||||
FILEOPENDIALOGOPTIONS
|
||||
FILEOS
|
||||
filesandordirs
|
||||
FILESUBTYPE
|
||||
FILESYSPATH
|
||||
Filetime
|
||||
FILEVERSION
|
||||
FILTERMODE
|
||||
FInc
|
||||
findfast
|
||||
FIXEDFILEINFO
|
||||
FIXEDSYS
|
||||
@@ -494,6 +538,7 @@ GPOCA
|
||||
gpp
|
||||
gpu
|
||||
gradians
|
||||
GRGX
|
||||
GSM
|
||||
gtm
|
||||
guiddata
|
||||
@@ -524,11 +569,13 @@ HCRYPTPROV
|
||||
hcursor
|
||||
hcwhite
|
||||
hdc
|
||||
HDEVNOTIFY
|
||||
hdr
|
||||
hdrop
|
||||
hdwwiz
|
||||
Helpline
|
||||
helptext
|
||||
hgdiobj
|
||||
HGFE
|
||||
hglobal
|
||||
hhk
|
||||
@@ -539,6 +586,7 @@ HIBYTE
|
||||
hicon
|
||||
HIDEWINDOW
|
||||
Hif
|
||||
highcontrast
|
||||
highlightbackground
|
||||
highlightthickness
|
||||
HIMAGELIST
|
||||
@@ -612,6 +660,7 @@ IEXPLORE
|
||||
IFACEMETHOD
|
||||
IFACEMETHODIMP
|
||||
IGNOREUNKNOWN
|
||||
ignoreversion
|
||||
IGo
|
||||
iid
|
||||
Iindex
|
||||
@@ -662,6 +711,8 @@ ipcmanager
|
||||
IPREVIEW
|
||||
irprops
|
||||
isbi
|
||||
ISCC
|
||||
isdl
|
||||
iss
|
||||
issecret
|
||||
ISSEPARATOR
|
||||
@@ -673,12 +724,13 @@ jfif
|
||||
jgeosdfsdsgmkedfgdfgdfgbkmhcgcflmi
|
||||
jjw
|
||||
jobject
|
||||
JOBOBJECT
|
||||
jpe
|
||||
jpnime
|
||||
jrsoftware
|
||||
Jsons
|
||||
jsonval
|
||||
jxr
|
||||
kbmcontrols
|
||||
keybd
|
||||
KEYBDDATA
|
||||
KEYBDINPUT
|
||||
@@ -707,6 +759,7 @@ Ldone
|
||||
Ldr
|
||||
LEFTSCROLLBAR
|
||||
LEFTTEXT
|
||||
leftclick
|
||||
LError
|
||||
LEVELID
|
||||
LExit
|
||||
@@ -738,6 +791,8 @@ lowlevel
|
||||
LOWORD
|
||||
lparam
|
||||
LPBITMAPINFOHEADER
|
||||
LPCFHOOKPROC
|
||||
lpch
|
||||
LPCITEMIDLIST
|
||||
LPCLSID
|
||||
lpcmi
|
||||
@@ -755,6 +810,7 @@ LPMONITORINFO
|
||||
LPOSVERSIONINFOEXW
|
||||
LPQUERY
|
||||
lprc
|
||||
LPrivate
|
||||
LPSAFEARRAY
|
||||
lpstr
|
||||
lpsz
|
||||
@@ -796,26 +852,33 @@ MAPPEDTOSAMEKEY
|
||||
MAPTOSAMESHORTCUT
|
||||
MAPVK
|
||||
MARKDOWNPREVIEWHANDLERCPP
|
||||
MAXDWORD
|
||||
MAXSHORTCUTSIZE
|
||||
maxversiontested
|
||||
MBM
|
||||
MBR
|
||||
Mbuttondown
|
||||
mcp
|
||||
MDICHILD
|
||||
MDL
|
||||
mdtext
|
||||
mdtxt
|
||||
mdwn
|
||||
measuretool
|
||||
mccs
|
||||
meme
|
||||
memicmp
|
||||
MENUITEMINFO
|
||||
MENUITEMINFOW
|
||||
MERGECOPY
|
||||
MERGEPAINT
|
||||
Metacharacter
|
||||
metadatamatters
|
||||
Metadatas
|
||||
Metacharacter
|
||||
metafile
|
||||
metapackage
|
||||
mfc
|
||||
mfalse
|
||||
Mgmt
|
||||
Microwaved
|
||||
midl
|
||||
@@ -838,6 +901,7 @@ mmsys
|
||||
mobileredirect
|
||||
mockapi
|
||||
MODALFRAME
|
||||
modelcontextprotocol
|
||||
MODESPRUNED
|
||||
MONITORENUMPROC
|
||||
MONITORINFO
|
||||
@@ -845,6 +909,7 @@ MONITORINFOEX
|
||||
MONITORINFOEXW
|
||||
monitorinfof
|
||||
MOUSEACTIVATE
|
||||
mousecrosshairs
|
||||
MOUSEDATA
|
||||
MOUSEEVENTF
|
||||
MOUSEHWHEEL
|
||||
@@ -872,16 +937,22 @@ MSLLHOOKSTRUCT
|
||||
Mso
|
||||
msrc
|
||||
msstore
|
||||
mstsc
|
||||
msvcp
|
||||
MT
|
||||
MTND
|
||||
mtrue
|
||||
multimonitor
|
||||
MULTIPLEUSE
|
||||
multizone
|
||||
muxc
|
||||
mvvm
|
||||
MVVMTK
|
||||
MWBEx
|
||||
mycompany
|
||||
myextension
|
||||
MYICON
|
||||
myorg
|
||||
myrepo
|
||||
NAMECHANGE
|
||||
namespaceanddescendants
|
||||
nao
|
||||
@@ -966,6 +1037,7 @@ NORMALDISPLAY
|
||||
NORMALUSER
|
||||
NOSEARCH
|
||||
NOSENDCHANGING
|
||||
notdefault
|
||||
NOTHOUSANDS
|
||||
NOTICKS
|
||||
NOTIFICATIONSDLL
|
||||
@@ -996,6 +1068,8 @@ OEMCONVERT
|
||||
officehubintl
|
||||
OFN
|
||||
ofs
|
||||
OICI
|
||||
OICIIO
|
||||
oldcolor
|
||||
olditem
|
||||
oldpath
|
||||
@@ -1006,6 +1080,7 @@ openas
|
||||
opencode
|
||||
OPENFILENAME
|
||||
opensource
|
||||
openurl
|
||||
openxmlformats
|
||||
OPTIMIZEFORINVOKE
|
||||
ORPHANEDDIALOGTITLE
|
||||
@@ -1028,6 +1103,7 @@ Packagemanager
|
||||
PACL
|
||||
padx
|
||||
pady
|
||||
PAI
|
||||
PAINTSTRUCT
|
||||
PALETTEWINDOW
|
||||
PARENTNOTIFY
|
||||
@@ -1052,6 +1128,7 @@ PCIDLIST
|
||||
PCTSTR
|
||||
PCWSTR
|
||||
PDEVMODE
|
||||
PDFs
|
||||
pdisp
|
||||
PDLL
|
||||
pdo
|
||||
@@ -1100,6 +1177,10 @@ Pokedex
|
||||
Popups
|
||||
POPUPWINDOW
|
||||
POSITIONITEM
|
||||
powerocr
|
||||
POWERBROADCAST
|
||||
powerdisplay
|
||||
POWERDISPLAYMODULEINTERFACE
|
||||
POWERRENAMECONTEXTMENU
|
||||
powerrenameinput
|
||||
POWERRENAMETEST
|
||||
@@ -1188,6 +1269,7 @@ Quarternary
|
||||
QUERYENDSESSION
|
||||
QUERYOPEN
|
||||
QUEUESYNC
|
||||
quicklinks
|
||||
QUNS
|
||||
RAII
|
||||
RAlt
|
||||
@@ -1200,6 +1282,7 @@ RAWPATH
|
||||
rbhid
|
||||
rclsid
|
||||
RCZOOMIT
|
||||
rdp
|
||||
RDW
|
||||
READMODE
|
||||
READOBJECTS
|
||||
@@ -1207,6 +1290,7 @@ recents
|
||||
RECTDESTINATION
|
||||
rectp
|
||||
RECTSOURCE
|
||||
recursesubdirs
|
||||
recyclebin
|
||||
Redist
|
||||
Reencode
|
||||
@@ -1227,6 +1311,7 @@ remappings
|
||||
REMAPSUCCESSFUL
|
||||
REMAPUNSUCCESSFUL
|
||||
Remotable
|
||||
remotedesktop
|
||||
remoteip
|
||||
Removelnk
|
||||
renamable
|
||||
@@ -1257,6 +1342,7 @@ RIGHTSCROLLBAR
|
||||
riid
|
||||
RKey
|
||||
RNumber
|
||||
rollups
|
||||
rop
|
||||
ROUNDSMALL
|
||||
rpcrt
|
||||
@@ -1272,6 +1358,7 @@ rundll
|
||||
rungameid
|
||||
RUNLEVEL
|
||||
runtimeclass
|
||||
runtimeconfig
|
||||
runtimepack
|
||||
ruuid
|
||||
rvm
|
||||
@@ -1289,7 +1376,7 @@ SCREENFONTS
|
||||
screensaver
|
||||
screenshots
|
||||
scrollviewer
|
||||
SDDL
|
||||
sddl
|
||||
SDKDDK
|
||||
sdns
|
||||
searchterm
|
||||
@@ -1459,8 +1546,12 @@ STYLECHANGING
|
||||
subkeys
|
||||
sublang
|
||||
SUBMODULEUPDATE
|
||||
subresource
|
||||
suntimes
|
||||
swp
|
||||
sug
|
||||
Superbar
|
||||
SUPPRESSMSGBOXES
|
||||
sut
|
||||
svchost
|
||||
SVGIn
|
||||
@@ -1468,6 +1559,9 @@ SVGIO
|
||||
svgz
|
||||
SVSI
|
||||
SWFO
|
||||
swp
|
||||
SWPNOSIZE
|
||||
SWPNOZORDER
|
||||
SWRESTORE
|
||||
symbolrequestprod
|
||||
SYMCACHE
|
||||
@@ -1484,8 +1578,11 @@ SYSKEY
|
||||
syskeydown
|
||||
SYSKEYUP
|
||||
SYSLIB
|
||||
sysmenu
|
||||
systemai
|
||||
SYSTEMAPPS
|
||||
SYSTEMMODAL
|
||||
systemroot
|
||||
SYSTEMTIME
|
||||
TARGETAPPHEADER
|
||||
targetentrypoint
|
||||
@@ -1521,6 +1618,7 @@ TILEDWINDOW
|
||||
TILLSON
|
||||
timedate
|
||||
timediff
|
||||
timespan
|
||||
timeutil
|
||||
TITLEBARINFO
|
||||
Titlecase
|
||||
@@ -1570,11 +1668,15 @@ UHash
|
||||
UIA
|
||||
UIEx
|
||||
ULONGLONG
|
||||
Ultrawide
|
||||
UMax
|
||||
UMin
|
||||
ums
|
||||
uncompilable
|
||||
UNCPRIORITY
|
||||
UNDNAME
|
||||
UNICODETEXT
|
||||
uninsdeletekey
|
||||
uninstalls
|
||||
Uniquifies
|
||||
unitconverter
|
||||
@@ -1590,6 +1692,7 @@ UOI
|
||||
UPDATENOW
|
||||
updown
|
||||
UPGRADINGPRODUCTCODE
|
||||
upserts
|
||||
Uptool
|
||||
urld
|
||||
Usb
|
||||
@@ -1620,6 +1723,7 @@ VERIFYCONTEXT
|
||||
VERSIONINFO
|
||||
VERTRES
|
||||
VERTSIZE
|
||||
VERYSILENT
|
||||
VFT
|
||||
vget
|
||||
vgetq
|
||||
@@ -1668,11 +1772,11 @@ wdm
|
||||
wdp
|
||||
wdupenv
|
||||
webbrowsers
|
||||
webdev
|
||||
webpage
|
||||
websites
|
||||
wekyb
|
||||
wgpocpl
|
||||
WIC
|
||||
wic
|
||||
wifi
|
||||
winapi
|
||||
@@ -2070,7 +2174,7 @@ nodiscard
|
||||
nologo
|
||||
nomove
|
||||
nosize
|
||||
notopmost
|
||||
NOTOPMOST
|
||||
Notupdated
|
||||
notwindows
|
||||
nowarn
|
||||
|
||||
9
.github/actions/spell-check/patterns.txt
vendored
9
.github/actions/spell-check/patterns.txt
vendored
@@ -191,15 +191,6 @@ aka\.ms/[a-zA-Z0-9]+
|
||||
# #pragma lib
|
||||
^\s*#pragma comment\(lib, ".*?"\)
|
||||
|
||||
# UnitTests
|
||||
\[DataRow\(.*\)\]
|
||||
|
||||
# AdditionalDependencies
|
||||
<AdditionalDependencies>.*<
|
||||
|
||||
# the last line of mimetype="application/x-microsoft.net.object.bytearray.base64" things in .resx files
|
||||
^\s*[-a-zA-Z=;:/0-9+]*[-a-zA-Z;:/0-9+][-a-zA-Z=;:/0-9+]*=$
|
||||
|
||||
RegExp\(@?([`'"]).*?\g{-1}\)|(?:escapes|regEx):\s*(?:/.*/|([`'"]).*?\g{-1})|return/.*?/
|
||||
|
||||
# Questionably acceptable forms of `in to`
|
||||
|
||||
24
.github/policies/resourceManagement.yml
vendored
24
.github/policies/resourceManagement.yml
vendored
@@ -233,6 +233,30 @@ configuration:
|
||||
- addReply:
|
||||
reply: Hi! Thanks for making us aware of the problem. We raised the issue with our internal localization team. This issue should be fixed hopefully in the next version of PowerToys.
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Issue_Comment
|
||||
- commentContains:
|
||||
pattern: '\/need-monitor-info'
|
||||
isRegex: True
|
||||
- hasLabel:
|
||||
label: Product-Cursor Wrap
|
||||
- or:
|
||||
- activitySenderHasAssociation:
|
||||
association: Owner
|
||||
- activitySenderHasAssociation:
|
||||
association: Member
|
||||
- activitySenderHasAssociation:
|
||||
association: Collaborator
|
||||
then:
|
||||
- removeLabel:
|
||||
label: Needs-Triage
|
||||
- removeLabel:
|
||||
label: Needs-Team-Response
|
||||
- addLabel:
|
||||
label: Needs-Author-Feedback
|
||||
- addReply:
|
||||
reply: "To help debug your layout, please run [this script](https://github.com/microsoft/PowerToys/blob/main/src/modules/MouseUtils/CursorWrap/CursorWrapTests/Capture-MonitorLayout.ps1) and attach the generated JSON output to this thread.\n\nThis allows us to better understand the issue and investigate potential fixes."
|
||||
description:
|
||||
- if:
|
||||
- payloadType: Issue_Comment
|
||||
- commentContains:
|
||||
|
||||
21
.github/skills/winmd-api-search/LICENSE.txt
vendored
Normal file
21
.github/skills/winmd-api-search/LICENSE.txt
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
192
.github/skills/winmd-api-search/SKILL.md
vendored
Normal file
192
.github/skills/winmd-api-search/SKILL.md
vendored
Normal file
@@ -0,0 +1,192 @@
|
||||
---
|
||||
name: winmd-api-search
|
||||
description: 'Find and explore Windows desktop APIs. Use when building features that need platform capabilities — camera, file access, notifications, UI controls, AI/ML, sensors, networking, etc. Discovers the right API for a task and retrieves full type details (methods, properties, events, enumeration values).'
|
||||
license: Complete terms in LICENSE.txt
|
||||
---
|
||||
|
||||
# WinMD API Search
|
||||
|
||||
This skill helps you find the right Windows API for any capability and get its full details. It searches a local cache of all WinMD metadata from:
|
||||
|
||||
- **Windows Platform SDK** — all `Windows.*` WinRT APIs (always available, no restore needed)
|
||||
- **WinAppSDK / WinUI** — bundled as a baseline in the cache generator (always available, no restore needed)
|
||||
- **NuGet packages** — any additional packages in restored projects that contain `.winmd` files
|
||||
- **Project-output WinMD** — class libraries (C++/WinRT, C#) that produce `.winmd` as build output
|
||||
|
||||
Even on a fresh clone with no restore or build, you still get full Platform SDK + WinAppSDK coverage.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
- User wants to build a feature and you need to find which API provides that capability
|
||||
- User asks "how do I do X?" where X involves a platform feature (camera, files, notifications, sensors, AI, etc.)
|
||||
- You need the exact methods, properties, events, or enumeration values of a type before writing code
|
||||
- You're unsure which control, class, or interface to use for a UI or system task
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- **.NET SDK 8.0 or later** — required to build the cache generator. Install from [dotnet.microsoft.com](https://dotnet.microsoft.com/download) if not available.
|
||||
|
||||
## Cache Setup (Required Before First Use)
|
||||
|
||||
All query and search commands read from a local JSON cache. **You must generate the cache before running any queries.**
|
||||
|
||||
```powershell
|
||||
# All projects in the repo (recommended for first run)
|
||||
.\.github\skills\winmd-api-search\scripts\Update-WinMdCache.ps1
|
||||
|
||||
# Single project
|
||||
.\.github\skills\winmd-api-search\scripts\Update-WinMdCache.ps1 -ProjectDir <project-folder>
|
||||
```
|
||||
|
||||
No project restore or build is needed for baseline coverage (Platform SDK + WinAppSDK). For additional NuGet packages, the project needs `dotnet restore` (which generates `project.assets.json`) or a `packages.config` file.
|
||||
|
||||
Cache is stored at `Generated Files\winmd-cache\`, deduplicated per-package+version.
|
||||
|
||||
### What gets indexed
|
||||
|
||||
| Source | When available |
|
||||
|--------|----------------|
|
||||
| Windows Platform SDK | Always (reads from local SDK install) |
|
||||
| WinAppSDK (latest) | Always (bundled as baseline in cache generator) |
|
||||
| WinAppSDK Runtime | When installed on the system (detected via `Get-AppxPackage`) |
|
||||
| Project NuGet packages | After `dotnet restore` or with `packages.config` |
|
||||
| Project-output `.winmd` | After project build (class libraries that produce WinMD) |
|
||||
|
||||
> **Note:** This cache directory should be in `.gitignore` — it's generated, not source.
|
||||
|
||||
## How to Use
|
||||
|
||||
Pick the path that matches the situation:
|
||||
|
||||
---
|
||||
|
||||
### Discover — "I don't know which API to use"
|
||||
|
||||
The user describes a capability in their own words. You need to find the right API.
|
||||
|
||||
**0. Ensure the cache exists**
|
||||
|
||||
If the cache hasn't been generated yet, run `Update-WinMdCache.ps1` first — see [Cache Setup](#cache-setup-required-before-first-use) above.
|
||||
|
||||
**1. Translate user language → search keywords**
|
||||
|
||||
Map the user's daily language to programming terms. Try multiple variations:
|
||||
|
||||
| User says | Search keywords to try (in order) |
|
||||
|-----------|-----------------------------------|
|
||||
| "take a picture" | `camera`, `capture`, `photo`, `MediaCapture` |
|
||||
| "load from disk" | `file open`, `picker`, `FileOpen`, `StorageFile` |
|
||||
| "describe what's in it" | `image description`, `Vision`, `Recognition` |
|
||||
| "show a popup" | `dialog`, `flyout`, `popup`, `ContentDialog` |
|
||||
| "drag and drop" | `drag`, `drop`, `DragDrop` |
|
||||
| "save settings" | `settings`, `ApplicationData`, `LocalSettings` |
|
||||
|
||||
Start with simple everyday words. If results are weak or irrelevant, try the more technical variation.
|
||||
|
||||
**2. Run searches**
|
||||
|
||||
```powershell
|
||||
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action search -Query "<keyword>"
|
||||
```
|
||||
|
||||
This returns ranked namespaces with top matching types and the **JSON file path**.
|
||||
|
||||
If results have **low scores (below 60) or are irrelevant**, fall back to searching online documentation:
|
||||
|
||||
1. Use web search to find the right API on Microsoft Learn, for example:
|
||||
- `site:learn.microsoft.com/uwp/api <capability keywords>` for `Windows.*` APIs
|
||||
- `site:learn.microsoft.com/windows/windows-app-sdk/api/winrt <capability keywords>` for `Microsoft.*` WinAppSDK APIs
|
||||
2. Read the documentation pages to identify which type matches the user's requirement.
|
||||
3. Once you know the type name, come back and use `-Action members` or `-Action enums` to get the exact local signatures.
|
||||
|
||||
**3. Read the JSON to choose the right API**
|
||||
|
||||
Read the file at the path(s) from the top results. The JSON has all types in that namespace — full members, signatures, parameters, return types, enumeration values.
|
||||
|
||||
Read and decide which types and members fit the user's requirement.
|
||||
|
||||
**4. Look up official documentation for context**
|
||||
|
||||
The cache contains only signatures — no descriptions or usage guidance. For explanations, examples, and remarks, look up the type on Microsoft Learn:
|
||||
|
||||
| Namespace prefix | Documentation base URL |
|
||||
|-----------------|----------------------|
|
||||
| `Windows.*` | `https://learn.microsoft.com/uwp/api/{fully.qualified.typename}` |
|
||||
| `Microsoft.*` (WinAppSDK) | `https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/{fully.qualified.typename}` |
|
||||
|
||||
For example, `Microsoft.UI.Xaml.Controls.NavigationView` maps to:
|
||||
`https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.navigationview`
|
||||
|
||||
**5. Use the API knowledge to answer or write code**
|
||||
|
||||
---
|
||||
|
||||
### Lookup — "I know the API, show me the details"
|
||||
|
||||
You already know (or suspect) the type or namespace name. Go direct:
|
||||
|
||||
```powershell
|
||||
# Get all members of a known type
|
||||
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action members -TypeName "Microsoft.UI.Xaml.Controls.NavigationView"
|
||||
|
||||
# Get enum values
|
||||
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action enums -TypeName "Microsoft.UI.Xaml.Visibility"
|
||||
|
||||
# List all types in a namespace
|
||||
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action types -Namespace "Microsoft.UI.Xaml.Controls"
|
||||
|
||||
# Browse namespaces
|
||||
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action namespaces -Filter "Microsoft.UI"
|
||||
```
|
||||
|
||||
If you need full detail beyond what `-Action members` shows, use `-Action search` to get the JSON file path, then read the JSON file directly.
|
||||
|
||||
---
|
||||
|
||||
### Other Commands
|
||||
|
||||
```powershell
|
||||
# List cached projects
|
||||
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action projects
|
||||
|
||||
# List packages for a project
|
||||
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action packages
|
||||
|
||||
# Show stats
|
||||
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action stats
|
||||
```
|
||||
|
||||
> If only one project is cached, `-Project` is auto-selected.
|
||||
> If multiple projects exist, add `-Project <name>` (use `-Action projects` to see available names).
|
||||
> In scan mode, manifest names include a short hash suffix to avoid collisions; you can pass the base project name without the suffix if it's unambiguous.
|
||||
|
||||
## Search Scoring
|
||||
|
||||
The search ranks type names and member names against your query:
|
||||
|
||||
| Score | Match type | Example |
|
||||
|-------|-----------|---------|
|
||||
| 100 | Exact name | `Button` → `Button` |
|
||||
| 80 | Starts with | `Navigation` → `NavigationView` |
|
||||
| 60 | Contains | `Dialog` → `ContentDialog` |
|
||||
| 50 | PascalCase initials | `ASB` → `AutoSuggestBox` |
|
||||
| 40 | Multi-keyword AND | `navigation item` → `NavigationViewItem` |
|
||||
| 20 | Fuzzy character match | `NavVw` → `NavigationView` |
|
||||
|
||||
Results are grouped by namespace. Higher-scored namespaces appear first.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
| Issue | Fix |
|
||||
|-------|-----|
|
||||
| "Cache not found" | Run `Update-WinMdCache.ps1` |
|
||||
| "Multiple projects cached" | Add `-Project <name>` |
|
||||
| "Namespace not found" | Use `-Action namespaces` to list available ones |
|
||||
| "Type not found" | Use fully qualified name (e.g., `Microsoft.UI.Xaml.Controls.Button`) |
|
||||
| Stale after NuGet update | Re-run `Update-WinMdCache.ps1` |
|
||||
| Cache in git history | Add `Generated Files/` to `.gitignore` |
|
||||
|
||||
## References
|
||||
|
||||
- [Windows Platform SDK API reference](https://learn.microsoft.com/uwp/api/) — documentation for `Windows.*` namespaces
|
||||
- [Windows App SDK API reference](https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/) — documentation for `Microsoft.*` WinAppSDK namespaces
|
||||
505
.github/skills/winmd-api-search/scripts/Invoke-WinMdQuery.ps1
vendored
Normal file
505
.github/skills/winmd-api-search/scripts/Invoke-WinMdQuery.ps1
vendored
Normal file
@@ -0,0 +1,505 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Query WinMD API metadata from cached JSON files.
|
||||
|
||||
.DESCRIPTION
|
||||
Reads pre-built JSON cache of WinMD types, members, and namespaces.
|
||||
The cache is organized per-package (deduplicated) with project manifests
|
||||
that map each project to its referenced packages.
|
||||
|
||||
Supports listing namespaces, types, members, searching, enum value lookup,
|
||||
and listing cached projects/packages.
|
||||
|
||||
.PARAMETER Action
|
||||
The query action to perform:
|
||||
- projects : List cached projects
|
||||
- packages : List packages for a project
|
||||
- stats : Show aggregate statistics for a project
|
||||
- namespaces : List all namespaces (optional -Filter prefix)
|
||||
- types : List types in a namespace (-Namespace required)
|
||||
- members : List members of a type (-TypeName required)
|
||||
- search : Search types and members by name (-Query required)
|
||||
- enums : List enum values (-TypeName required)
|
||||
|
||||
.PARAMETER Project
|
||||
Project name to query. Auto-selected if only one project is cached.
|
||||
Use -Action projects to list available projects.
|
||||
|
||||
.PARAMETER Namespace
|
||||
Namespace to query types from (used with -Action types).
|
||||
|
||||
.PARAMETER TypeName
|
||||
Full type name e.g. "Microsoft.UI.Xaml.Controls.Button" (used with -Action members, enums).
|
||||
|
||||
.PARAMETER Query
|
||||
Search query string (used with -Action search).
|
||||
|
||||
.PARAMETER Filter
|
||||
Optional prefix filter for namespaces (used with -Action namespaces).
|
||||
|
||||
.PARAMETER CacheDir
|
||||
Path to the winmd-cache directory. Defaults to "Generated Files\winmd-cache"
|
||||
relative to the workspace root.
|
||||
|
||||
.PARAMETER MaxResults
|
||||
Maximum number of results to return for search. Defaults to 30.
|
||||
|
||||
.EXAMPLE
|
||||
.\Invoke-WinMdQuery.ps1 -Action projects
|
||||
.\Invoke-WinMdQuery.ps1 -Action packages -Project BlankWinUI
|
||||
.\Invoke-WinMdQuery.ps1 -Action stats -Project BlankWinUI
|
||||
.\Invoke-WinMdQuery.ps1 -Action namespaces -Filter "Microsoft.UI"
|
||||
.\Invoke-WinMdQuery.ps1 -Action types -Namespace "Microsoft.UI.Xaml.Controls"
|
||||
.\Invoke-WinMdQuery.ps1 -Action members -TypeName "Microsoft.UI.Xaml.Controls.Button"
|
||||
.\Invoke-WinMdQuery.ps1 -Action search -Query "NavigationView"
|
||||
.\Invoke-WinMdQuery.ps1 -Action enums -TypeName "Microsoft.UI.Xaml.Visibility"
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[ValidateSet('projects', 'packages', 'stats', 'namespaces', 'types', 'members', 'search', 'enums')]
|
||||
[string]$Action,
|
||||
|
||||
[string]$Project,
|
||||
[string]$Namespace,
|
||||
[string]$TypeName,
|
||||
[string]$Query,
|
||||
[string]$Filter,
|
||||
[string]$CacheDir,
|
||||
[int]$MaxResults = 30
|
||||
)
|
||||
|
||||
# ─── Resolve cache directory ─────────────────────────────────────────────────
|
||||
|
||||
if (-not $CacheDir) {
|
||||
# Convention: skill lives at .github/skills/winmd-api-search/scripts/
|
||||
# so workspace root is 4 levels up from $PSScriptRoot.
|
||||
$scriptDir = $PSScriptRoot
|
||||
$root = (Resolve-Path (Join-Path $scriptDir '..\..\..\..')).Path
|
||||
$CacheDir = Join-Path $root 'Generated Files\winmd-cache'
|
||||
}
|
||||
|
||||
if (-not (Test-Path $CacheDir)) {
|
||||
Write-Error "Cache not found at: $CacheDir`nRun: .\Update-WinMdCache.ps1 (from .github\skills\winmd-api-search\scripts\)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# ─── Project resolution helpers ──────────────────────────────────────────────
|
||||
|
||||
function Get-CachedProjects {
|
||||
$projectsDir = Join-Path $CacheDir 'projects'
|
||||
if (-not (Test-Path $projectsDir)) { return @() }
|
||||
Get-ChildItem $projectsDir -Filter '*.json' | ForEach-Object { $_.BaseName }
|
||||
}
|
||||
|
||||
function Resolve-ProjectManifest {
|
||||
param([string]$Name)
|
||||
|
||||
$projectsDir = Join-Path $CacheDir 'projects'
|
||||
if (-not (Test-Path $projectsDir)) {
|
||||
Write-Error "No projects cached. Run Update-WinMdCache.ps1 first."
|
||||
exit 1
|
||||
}
|
||||
|
||||
if ($Name) {
|
||||
$path = Join-Path $projectsDir "$Name.json"
|
||||
if (-not (Test-Path $path)) {
|
||||
# Scan mode appends a hash suffix -- try prefix match
|
||||
$matching = @(Get-ChildItem $projectsDir -Filter "${Name}_*.json" -ErrorAction SilentlyContinue)
|
||||
if ($matching.Count -eq 1) {
|
||||
return Get-Content $matching[0].FullName -Raw | ConvertFrom-Json
|
||||
}
|
||||
if ($matching.Count -gt 1) {
|
||||
$names = ($matching | ForEach-Object { $_.BaseName }) -join ', '
|
||||
Write-Error "Multiple projects match '$Name'. Specify the full name: $names"
|
||||
exit 1
|
||||
}
|
||||
$available = (Get-CachedProjects) -join ', '
|
||||
Write-Error "Project '$Name' not found. Available: $available"
|
||||
exit 1
|
||||
}
|
||||
return Get-Content $path -Raw | ConvertFrom-Json
|
||||
}
|
||||
|
||||
# Auto-select if only one project
|
||||
$manifests = Get-ChildItem $projectsDir -Filter '*.json' -ErrorAction SilentlyContinue
|
||||
if ($manifests.Count -eq 0) {
|
||||
Write-Error "No projects cached. Run Update-WinMdCache.ps1 first."
|
||||
exit 1
|
||||
}
|
||||
if ($manifests.Count -eq 1) {
|
||||
return Get-Content $manifests[0].FullName -Raw | ConvertFrom-Json
|
||||
}
|
||||
|
||||
$available = ($manifests | ForEach-Object { $_.BaseName }) -join ', '
|
||||
Write-Error "Multiple projects cached -- use -Project to specify. Available: $available"
|
||||
exit 1
|
||||
}
|
||||
|
||||
function Get-PackageCacheDirs {
|
||||
param($Manifest)
|
||||
$dirs = @()
|
||||
foreach ($pkg in $Manifest.packages) {
|
||||
$dir = Join-Path (Join-Path (Join-Path $CacheDir 'packages') $pkg.id) $pkg.version
|
||||
if (Test-Path $dir) {
|
||||
$dirs += $dir
|
||||
}
|
||||
}
|
||||
return $dirs
|
||||
}
|
||||
|
||||
# ─── Action: projects ────────────────────────────────────────────────────────
|
||||
|
||||
function Show-Projects {
|
||||
$projects = Get-CachedProjects
|
||||
if ($projects.Count -eq 0) {
|
||||
Write-Output "No projects cached."
|
||||
return
|
||||
}
|
||||
Write-Output "Cached projects ($($projects.Count)):"
|
||||
foreach ($p in $projects) {
|
||||
$manifest = Get-Content (Join-Path (Join-Path $CacheDir 'projects') "$p.json") -Raw | ConvertFrom-Json
|
||||
$pkgCount = $manifest.packages.Count
|
||||
Write-Output " $p ($pkgCount package(s))"
|
||||
}
|
||||
}
|
||||
|
||||
# ─── Action: packages ────────────────────────────────────────────────────────
|
||||
|
||||
function Show-Packages {
|
||||
$manifest = Resolve-ProjectManifest -Name $Project
|
||||
Write-Output "Packages for project '$($manifest.projectName)' ($($manifest.packages.Count)):"
|
||||
foreach ($pkg in $manifest.packages) {
|
||||
$metaPath = Join-Path (Join-Path (Join-Path (Join-Path $CacheDir 'packages') $pkg.id) $pkg.version) 'meta.json'
|
||||
if (Test-Path $metaPath) {
|
||||
$meta = Get-Content $metaPath -Raw | ConvertFrom-Json
|
||||
Write-Output " $($pkg.id)@$($pkg.version) -- $($meta.totalTypes) types, $($meta.totalMembers) members"
|
||||
} else {
|
||||
Write-Output " $($pkg.id)@$($pkg.version) -- (cache missing)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ─── Action: stats ───────────────────────────────────────────────────────────
|
||||
|
||||
function Show-Stats {
|
||||
$manifest = Resolve-ProjectManifest -Name $Project
|
||||
$totalTypes = 0
|
||||
$totalMembers = 0
|
||||
$totalNamespaces = 0
|
||||
$totalWinMd = 0
|
||||
|
||||
foreach ($pkg in $manifest.packages) {
|
||||
$metaPath = Join-Path (Join-Path (Join-Path (Join-Path $CacheDir 'packages') $pkg.id) $pkg.version) 'meta.json'
|
||||
if (Test-Path $metaPath) {
|
||||
$meta = Get-Content $metaPath -Raw | ConvertFrom-Json
|
||||
$totalTypes += $meta.totalTypes
|
||||
$totalMembers += $meta.totalMembers
|
||||
$totalNamespaces += $meta.totalNamespaces
|
||||
$totalWinMd += $meta.winMdFiles.Count
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output "WinMD Index Statistics -- $($manifest.projectName)"
|
||||
Write-Output "======================================"
|
||||
Write-Output " Packages: $($manifest.packages.Count)"
|
||||
Write-Output " Namespaces: $totalNamespaces (may overlap across packages)"
|
||||
Write-Output " Types: $totalTypes"
|
||||
Write-Output " Members: $totalMembers"
|
||||
Write-Output " WinMD files: $totalWinMd"
|
||||
}
|
||||
|
||||
# ─── Action: namespaces ──────────────────────────────────────────────────────
|
||||
|
||||
function Get-Namespaces {
|
||||
param([string]$Prefix)
|
||||
$manifest = Resolve-ProjectManifest -Name $Project
|
||||
$dirs = Get-PackageCacheDirs -Manifest $manifest
|
||||
$allNs = @()
|
||||
|
||||
foreach ($dir in $dirs) {
|
||||
$nsFile = Join-Path $dir 'namespaces.json'
|
||||
if (Test-Path $nsFile) {
|
||||
$allNs += (Get-Content $nsFile -Raw | ConvertFrom-Json)
|
||||
}
|
||||
}
|
||||
|
||||
$allNs = $allNs | Sort-Object -Unique
|
||||
if ($Prefix) {
|
||||
$allNs = $allNs | Where-Object { $_ -like "$Prefix*" }
|
||||
}
|
||||
$allNs | ForEach-Object { Write-Output $_ }
|
||||
}
|
||||
|
||||
# ─── Action: types ───────────────────────────────────────────────────────────
|
||||
|
||||
function Get-TypesInNamespace {
|
||||
param([string]$Ns)
|
||||
if (-not $Ns) {
|
||||
Write-Error "-Namespace is required for 'types' action."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$manifest = Resolve-ProjectManifest -Name $Project
|
||||
$dirs = Get-PackageCacheDirs -Manifest $manifest
|
||||
$safeFile = $Ns.Replace('.', '_') + '.json'
|
||||
$found = $false
|
||||
$seen = @{}
|
||||
|
||||
foreach ($dir in $dirs) {
|
||||
$filePath = Join-Path $dir "types\$safeFile"
|
||||
if (-not (Test-Path $filePath)) { continue }
|
||||
$found = $true
|
||||
$types = Get-Content $filePath -Raw | ConvertFrom-Json
|
||||
foreach ($t in $types) {
|
||||
if ($seen.ContainsKey($t.fullName)) { continue }
|
||||
$seen[$t.fullName] = $true
|
||||
Write-Output "$($t.kind) $($t.fullName)$(if ($t.baseType) { " : $($t.baseType)" } else { '' })"
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $found) {
|
||||
Write-Error "Namespace not found: $Ns"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# ─── Action: members ─────────────────────────────────────────────────────────
|
||||
|
||||
function Get-MembersOfType {
|
||||
param([string]$FullName)
|
||||
if (-not $FullName) {
|
||||
Write-Error "-TypeName is required for 'members' action."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$lastDot = $FullName.LastIndexOf('.')
|
||||
if ($lastDot -lt 0) {
|
||||
Write-Error "-TypeName must include a namespace (for example: 'MyNamespace.MyType'). Provided: $FullName"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$ns = $FullName.Substring(0, $lastDot)
|
||||
$safeFile = $ns.Replace('.', '_') + '.json'
|
||||
|
||||
$manifest = Resolve-ProjectManifest -Name $Project
|
||||
$dirs = Get-PackageCacheDirs -Manifest $manifest
|
||||
|
||||
foreach ($dir in $dirs) {
|
||||
$filePath = Join-Path $dir "types\$safeFile"
|
||||
if (-not (Test-Path $filePath)) { continue }
|
||||
|
||||
$types = Get-Content $filePath -Raw | ConvertFrom-Json
|
||||
$type = $types | Where-Object { $_.fullName -eq $FullName }
|
||||
if (-not $type) { continue }
|
||||
|
||||
Write-Output "$($type.kind) $($type.fullName)"
|
||||
if ($type.baseType) { Write-Output " Extends: $($type.baseType)" }
|
||||
Write-Output ""
|
||||
foreach ($m in $type.members) {
|
||||
Write-Output " [$($m.kind)] $($m.signature)"
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Write-Error "Type not found: $FullName"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# ─── Action: search ──────────────────────────────────────────────────────────
|
||||
# Ranks namespaces by best match score on type names and member names.
|
||||
# Outputs: ranked namespaces with top matching types and the JSON file path.
|
||||
# The agent can then read the JSON file to inspect all members intelligently.
|
||||
|
||||
function Search-WinMd {
|
||||
param([string]$SearchQuery, [int]$Max)
|
||||
if (-not $SearchQuery) {
|
||||
Write-Error "-Query is required for 'search' action."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$manifest = Resolve-ProjectManifest -Name $Project
|
||||
$dirs = Get-PackageCacheDirs -Manifest $manifest
|
||||
|
||||
# Collect: namespace -> { bestScore, matchingTypes[], filePath }
|
||||
$nsResults = @{}
|
||||
|
||||
foreach ($dir in $dirs) {
|
||||
$nsFile = Join-Path $dir 'namespaces.json'
|
||||
if (-not (Test-Path $nsFile)) { continue }
|
||||
$nsList = Get-Content $nsFile -Raw | ConvertFrom-Json
|
||||
|
||||
foreach ($n in $nsList) {
|
||||
$safeFile = $n.Replace('.', '_') + '.json'
|
||||
$filePath = Join-Path $dir "types\$safeFile"
|
||||
if (-not (Test-Path $filePath)) { continue }
|
||||
|
||||
$types = Get-Content $filePath -Raw | ConvertFrom-Json
|
||||
foreach ($t in $types) {
|
||||
$typeScore = Get-MatchScore -Name $t.name -FullName $t.fullName -Query $SearchQuery
|
||||
|
||||
# Also search member names for matches
|
||||
$bestMemberScore = 0
|
||||
$matchingMember = $null
|
||||
if ($t.members) {
|
||||
foreach ($m in $t.members) {
|
||||
$memberName = $m.name
|
||||
$mScore = Get-MatchScore -Name $memberName -FullName "$($t.fullName).$memberName" -Query $SearchQuery
|
||||
if ($mScore -gt $bestMemberScore) {
|
||||
$bestMemberScore = $mScore
|
||||
$matchingMember = $m.signature
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$score = [Math]::Max($typeScore, $bestMemberScore)
|
||||
if ($score -le 0) { continue }
|
||||
|
||||
if (-not $nsResults.ContainsKey($n)) {
|
||||
$nsResults[$n] = @{ BestScore = 0; Types = @(); FilePaths = @() }
|
||||
}
|
||||
$entry = $nsResults[$n]
|
||||
if ($score -gt $entry.BestScore) { $entry.BestScore = $score }
|
||||
if ($entry.FilePaths -notcontains $filePath) {
|
||||
$entry.FilePaths += $filePath
|
||||
}
|
||||
|
||||
if ($typeScore -ge $bestMemberScore) {
|
||||
$entry.Types += @{ Text = "$($t.kind) $($t.fullName) [$typeScore]"; Score = $typeScore }
|
||||
} else {
|
||||
$entry.Types += @{ Text = "$($t.kind) $($t.fullName) -> $matchingMember [$bestMemberScore]"; Score = $bestMemberScore }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($nsResults.Count -eq 0) {
|
||||
Write-Output "No results found for: $SearchQuery"
|
||||
return
|
||||
}
|
||||
|
||||
$ranked = $nsResults.GetEnumerator() |
|
||||
Sort-Object { $_.Value.BestScore } -Descending |
|
||||
Select-Object -First $Max
|
||||
|
||||
foreach ($r in $ranked) {
|
||||
$ns = $r.Key
|
||||
$info = $r.Value
|
||||
Write-Output "[$($info.BestScore)] $ns"
|
||||
foreach ($fp in $info.FilePaths) {
|
||||
Write-Output " File: $fp"
|
||||
}
|
||||
# Show top 5 highest-scoring matching types in this namespace
|
||||
$info.Types | Sort-Object { $_.Score } -Descending |
|
||||
Select-Object -First 5 |
|
||||
ForEach-Object { Write-Output " $($_.Text)" }
|
||||
Write-Output ""
|
||||
}
|
||||
}
|
||||
|
||||
# ─── Search scoring ──────────────────────────────────────────────────────────
|
||||
# Simple ranked scoring on type names. Higher = better.
|
||||
# 100 = exact name 80 = starts-with 60 = substring
|
||||
# 50 = PascalCase 40 = multi-keyword 20 = fuzzy subsequence
|
||||
|
||||
function Get-MatchScore {
|
||||
param([string]$Name, [string]$FullName, [string]$Query)
|
||||
|
||||
$q = $Query.Trim()
|
||||
if (-not $q) { return 0 }
|
||||
|
||||
if ($Name -eq $q) { return 100 }
|
||||
if ($Name -like "$q*") { return 80 }
|
||||
if ($Name -like "*$q*" -or $FullName -like "*$q*") { return 60 }
|
||||
|
||||
$initials = ($Name.ToCharArray() | Where-Object { [char]::IsUpper($_) }) -join ''
|
||||
if ($initials.Length -ge 2 -and $initials -like "*$q*") { return 50 }
|
||||
|
||||
$words = $q -split '\s+' | Where-Object { $_.Length -gt 0 }
|
||||
if ($words.Count -gt 1) {
|
||||
$allFound = $true
|
||||
foreach ($w in $words) {
|
||||
if ($Name -notlike "*$w*" -and $FullName -notlike "*$w*") {
|
||||
$allFound = $false
|
||||
break
|
||||
}
|
||||
}
|
||||
if ($allFound) { return 40 }
|
||||
}
|
||||
|
||||
if (Test-FuzzySubsequence -Text $Name -Pattern $q) { return 20 }
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function Test-FuzzySubsequence {
|
||||
param([string]$Text, [string]$Pattern)
|
||||
$ti = 0
|
||||
$tLower = $Text.ToLowerInvariant()
|
||||
$pLower = $Pattern.ToLowerInvariant()
|
||||
foreach ($ch in $pLower.ToCharArray()) {
|
||||
$idx = $tLower.IndexOf($ch, $ti)
|
||||
if ($idx -lt 0) { return $false }
|
||||
$ti = $idx + 1
|
||||
}
|
||||
return $true
|
||||
}
|
||||
|
||||
# ─── Action: enums ───────────────────────────────────────────────────────────
|
||||
|
||||
function Get-EnumValues {
|
||||
param([string]$FullName)
|
||||
if (-not $FullName) {
|
||||
Write-Error "-TypeName is required for 'enums' action."
|
||||
exit 1
|
||||
}
|
||||
|
||||
$lastDot = $FullName.LastIndexOf('.')
|
||||
if ($lastDot -lt 1) {
|
||||
Write-Error "-TypeName must be a fully-qualified type name including namespace, e.g. 'Namespace.TypeName'. Provided: $FullName"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$ns = $FullName.Substring(0, $lastDot)
|
||||
$safeFile = $ns.Replace('.', '_') + '.json'
|
||||
|
||||
$manifest = Resolve-ProjectManifest -Name $Project
|
||||
$dirs = Get-PackageCacheDirs -Manifest $manifest
|
||||
|
||||
foreach ($dir in $dirs) {
|
||||
$filePath = Join-Path $dir "types\$safeFile"
|
||||
if (-not (Test-Path $filePath)) { continue }
|
||||
|
||||
$types = Get-Content $filePath -Raw | ConvertFrom-Json
|
||||
$type = $types | Where-Object { $_.fullName -eq $FullName }
|
||||
if (-not $type) { continue }
|
||||
|
||||
if ($type.kind -ne 'Enum') {
|
||||
Write-Error "$FullName is not an Enum (kind: $($type.kind))"
|
||||
exit 1
|
||||
}
|
||||
Write-Output "Enum $($type.fullName)"
|
||||
if ($type.enumValues) {
|
||||
$type.enumValues | ForEach-Object { Write-Output " $_" }
|
||||
} else {
|
||||
Write-Output " (no values)"
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Write-Error "Type not found: $FullName"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# ─── Dispatch ─────────────────────────────────────────────────────────────────
|
||||
|
||||
switch ($Action) {
|
||||
'projects' { Show-Projects }
|
||||
'packages' { Show-Packages }
|
||||
'stats' { Show-Stats }
|
||||
'namespaces' { Get-Namespaces -Prefix $Filter }
|
||||
'types' { Get-TypesInNamespace -Ns $Namespace }
|
||||
'members' { Get-MembersOfType -FullName $TypeName }
|
||||
'search' { Search-WinMd -SearchQuery $Query -Max $MaxResults }
|
||||
'enums' { Get-EnumValues -FullName $TypeName }
|
||||
}
|
||||
208
.github/skills/winmd-api-search/scripts/Update-WinMdCache.ps1
vendored
Normal file
208
.github/skills/winmd-api-search/scripts/Update-WinMdCache.ps1
vendored
Normal file
@@ -0,0 +1,208 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generate or refresh the WinMD cache for the Agent Skill.
|
||||
|
||||
.DESCRIPTION
|
||||
Builds and runs the standalone cache generator to export cached JSON files
|
||||
from all WinMD metadata found in project NuGet packages and Windows SDK.
|
||||
|
||||
The cache is per-package+version: if two projects reference the same
|
||||
package at the same version, the WinMD data is parsed once and shared.
|
||||
|
||||
Supports single project or recursive scan of an entire repo.
|
||||
|
||||
.PARAMETER ProjectDir
|
||||
Path to a project directory (contains .csproj/.vcxproj), or a project file itself.
|
||||
Defaults to scanning the workspace root.
|
||||
|
||||
.PARAMETER Scan
|
||||
Recursively discover all .csproj/.vcxproj files under ProjectDir.
|
||||
|
||||
.PARAMETER OutputDir
|
||||
Path to the cache output directory. Defaults to "Generated Files\winmd-cache".
|
||||
|
||||
.EXAMPLE
|
||||
.\Update-WinMdCache.ps1
|
||||
.\Update-WinMdCache.ps1 -ProjectDir BlankWinUI
|
||||
.\Update-WinMdCache.ps1 -Scan -ProjectDir .
|
||||
.\Update-WinMdCache.ps1 -ProjectDir "src\MyApp\MyApp.csproj"
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$ProjectDir,
|
||||
[switch]$Scan,
|
||||
[string]$OutputDir = 'Generated Files\winmd-cache'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# Convention: skill lives at .github/skills/winmd-api-search/scripts/
|
||||
# so workspace root is 4 levels up from $PSScriptRoot.
|
||||
$root = (Resolve-Path (Join-Path $PSScriptRoot '..\..\..\..')).Path
|
||||
$generatorProj = Join-Path (Join-Path $PSScriptRoot 'cache-generator') 'CacheGenerator.csproj'
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# WinAppSDK version detection -- look only at the repo root folder (no recursion)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
function Get-WinAppSdkVersionFromDirectoryPackagesProps {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Extract Microsoft.WindowsAppSDK version from a Directory.Packages.props
|
||||
(Central Package Management) at the repo root.
|
||||
#>
|
||||
param([string]$RepoRoot)
|
||||
$propsFile = Join-Path $RepoRoot 'Directory.Packages.props'
|
||||
if (-not (Test-Path $propsFile)) { return $null }
|
||||
try {
|
||||
[xml]$xml = Get-Content $propsFile -Raw
|
||||
$node = $xml.SelectNodes('//PackageVersion') |
|
||||
Where-Object { $_.Include -eq 'Microsoft.WindowsAppSDK' } |
|
||||
Select-Object -First 1
|
||||
if ($node) { return $node.Version }
|
||||
} catch {
|
||||
Write-Verbose "Could not parse $propsFile : $_"
|
||||
}
|
||||
return $null
|
||||
}
|
||||
|
||||
function Get-WinAppSdkVersionFromPackagesConfig {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Extract Microsoft.WindowsAppSDK version from a packages.config at the repo root.
|
||||
#>
|
||||
param([string]$RepoRoot)
|
||||
$configFile = Join-Path $RepoRoot 'packages.config'
|
||||
if (-not (Test-Path $configFile)) { return $null }
|
||||
try {
|
||||
[xml]$xml = Get-Content $configFile -Raw
|
||||
$node = $xml.SelectNodes('//package') |
|
||||
Where-Object { $_.id -eq 'Microsoft.WindowsAppSDK' } |
|
||||
Select-Object -First 1
|
||||
if ($node) { return $node.version }
|
||||
} catch {
|
||||
Write-Verbose "Could not parse $configFile : $_"
|
||||
}
|
||||
return $null
|
||||
}
|
||||
|
||||
# Try Directory.Packages.props first (CPM), then packages.config
|
||||
$winAppSdkVersion = Get-WinAppSdkVersionFromDirectoryPackagesProps -RepoRoot $root
|
||||
if (-not $winAppSdkVersion) {
|
||||
$winAppSdkVersion = Get-WinAppSdkVersionFromPackagesConfig -RepoRoot $root
|
||||
}
|
||||
if ($winAppSdkVersion) {
|
||||
Write-Host "Detected WinAppSDK version from repo: $winAppSdkVersion" -ForegroundColor Cyan
|
||||
} else {
|
||||
Write-Host "No WinAppSDK version found at repo root; will use latest (Version=*)" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
# Default: if no ProjectDir, scan the workspace root
|
||||
if (-not $ProjectDir) {
|
||||
$ProjectDir = $root
|
||||
$Scan = $true
|
||||
}
|
||||
|
||||
Push-Location $root
|
||||
|
||||
try {
|
||||
# Detect installed .NET SDK -- require >= 8.0, prefer stable over preview
|
||||
$dotnetSdks = dotnet --list-sdks 2>$null
|
||||
$bestMajor = $dotnetSdks |
|
||||
Where-Object { $_ -notmatch 'preview|rc|alpha|beta' } |
|
||||
ForEach-Object { if ($_ -match '^(\d+)\.') { [int]$Matches[1] } } |
|
||||
Where-Object { $_ -ge 8 } |
|
||||
Sort-Object -Descending |
|
||||
Select-Object -First 1
|
||||
|
||||
# Fall back to preview SDKs if no stable SDK found
|
||||
if (-not $bestMajor) {
|
||||
$bestMajor = $dotnetSdks |
|
||||
ForEach-Object { if ($_ -match '^(\d+)\.') { [int]$Matches[1] } } |
|
||||
Where-Object { $_ -ge 8 } |
|
||||
Sort-Object -Descending |
|
||||
Select-Object -First 1
|
||||
}
|
||||
|
||||
if (-not $bestMajor) {
|
||||
Write-Error "No .NET SDK >= 8.0 found. Install from https://dotnet.microsoft.com/download"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$targetFramework = "net$bestMajor.0"
|
||||
Write-Host "Using .NET SDK: $targetFramework" -ForegroundColor Cyan
|
||||
|
||||
# Build MSBuild properties -- pass detected WinAppSDK version when available
|
||||
$sdkVersionProp = ''
|
||||
if ($winAppSdkVersion) {
|
||||
$sdkVersionProp = "-p:WinAppSdkVersion=$winAppSdkVersion"
|
||||
}
|
||||
|
||||
Write-Host "Building cache generator..." -ForegroundColor Cyan
|
||||
$restoreArgs = @($generatorProj, "-p:TargetFramework=$targetFramework", '--nologo', '-v', 'q')
|
||||
if ($sdkVersionProp) { $restoreArgs += $sdkVersionProp }
|
||||
dotnet restore @restoreArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Restore failed"
|
||||
exit 1
|
||||
}
|
||||
$buildArgs = @($generatorProj, '-c', 'Release', '--nologo', '-v', 'q', "-p:TargetFramework=$targetFramework", '--no-restore')
|
||||
if ($sdkVersionProp) { $buildArgs += $sdkVersionProp }
|
||||
dotnet build @buildArgs
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Build failed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Run the built executable directly (avoids dotnet run target framework mismatch issues)
|
||||
$generatorDir = Join-Path $PSScriptRoot 'cache-generator'
|
||||
$exePath = Join-Path $generatorDir "bin\Release\$targetFramework\CacheGenerator.exe"
|
||||
if (-not (Test-Path $exePath)) {
|
||||
# Fallback: try dll with dotnet
|
||||
$dllPath = Join-Path $generatorDir "bin\Release\$targetFramework\CacheGenerator.dll"
|
||||
if (Test-Path $dllPath) {
|
||||
$exePath = $null
|
||||
} else {
|
||||
Write-Error "Built executable not found at: $exePath"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
$runArgs = @()
|
||||
if ($Scan) {
|
||||
$runArgs += '--scan'
|
||||
}
|
||||
|
||||
# Detect installed WinAppSDK runtime via Get-AppxPackage (the WindowsApps
|
||||
# folder is ACL-restricted so C# cannot enumerate it directly).
|
||||
# WinMD files are architecture-independent metadata, so pick whichever arch
|
||||
# matches the current OS to ensure the package is present.
|
||||
$osArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()
|
||||
$runtimePkg = Get-AppxPackage -Name 'Microsoft.WindowsAppRuntime.*' -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.Name -notmatch 'CBS' -and $_.Architecture -eq $osArch } |
|
||||
Sort-Object -Property Version -Descending |
|
||||
Select-Object -First 1
|
||||
if ($runtimePkg -and $runtimePkg.InstallLocation -and (Test-Path $runtimePkg.InstallLocation)) {
|
||||
Write-Host "Detected WinAppSDK runtime: $($runtimePkg.Name) v$($runtimePkg.Version)" -ForegroundColor Cyan
|
||||
$runArgs += '--winappsdk-runtime'
|
||||
$runArgs += $runtimePkg.InstallLocation
|
||||
}
|
||||
|
||||
$runArgs += $ProjectDir
|
||||
$runArgs += $OutputDir
|
||||
|
||||
Write-Host "Exporting WinMD cache..." -ForegroundColor Cyan
|
||||
if ($exePath) {
|
||||
& $exePath @runArgs
|
||||
} else {
|
||||
dotnet $dllPath @runArgs
|
||||
}
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Cache export failed"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Cache updated at: $OutputDir" -ForegroundColor Green
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
29
.github/skills/winmd-api-search/scripts/cache-generator/CacheGenerator.csproj
vendored
Normal file
29
.github/skills/winmd-api-search/scripts/cache-generator/CacheGenerator.csproj
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<!-- Default fallback; Update-WinMdCache.ps1 overrides via -p:TargetFramework=net{X}.0 -->
|
||||
<TargetFramework Condition="'$(TargetFramework)' == ''">net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
<!-- System.Reflection.Metadata is inbox in net9.0+, only needed for net8.0 -->
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
|
||||
<PackageReference Include="System.Reflection.Metadata" Version="8.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<!--
|
||||
Baseline WinAppSDK packages: downloaded during restore so the cache generator
|
||||
can always index WinAppSDK APIs, even if the target project hasn't been restored.
|
||||
ExcludeAssets="all" means they're downloaded but don't affect this tool's build.
|
||||
|
||||
When the repo has a known version (passed via -p:WinAppSdkVersion=X.Y.Z from
|
||||
Update-WinMdCache.ps1), prefer that version to avoid unnecessary NuGet downloads.
|
||||
Falls back to Version="*" (latest) on fresh clones with no restore.
|
||||
-->
|
||||
<ItemGroup Condition="'$(WinAppSdkVersion)' != ''">
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="$(WinAppSdkVersion)" ExcludeAssets="all" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(WinAppSdkVersion)' == ''">
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="*" ExcludeAssets="all" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
3
.github/skills/winmd-api-search/scripts/cache-generator/Directory.Build.props
vendored
Normal file
3
.github/skills/winmd-api-search/scripts/cache-generator/Directory.Build.props
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<Project>
|
||||
<!-- Isolate this standalone tool from the repo-level build configuration -->
|
||||
</Project>
|
||||
3
.github/skills/winmd-api-search/scripts/cache-generator/Directory.Build.targets
vendored
Normal file
3
.github/skills/winmd-api-search/scripts/cache-generator/Directory.Build.targets
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<Project>
|
||||
<!-- Isolate this standalone tool from the repo-level build targets -->
|
||||
</Project>
|
||||
3
.github/skills/winmd-api-search/scripts/cache-generator/Directory.Packages.props
vendored
Normal file
3
.github/skills/winmd-api-search/scripts/cache-generator/Directory.Packages.props
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<Project>
|
||||
<!-- Isolate this standalone tool from the repo-level Central Package Management -->
|
||||
</Project>
|
||||
1222
.github/skills/winmd-api-search/scripts/cache-generator/Program.cs
vendored
Normal file
1222
.github/skills/winmd-api-search/scripts/cache-generator/Program.cs
vendored
Normal file
File diff suppressed because it is too large
Load Diff
165
.github/skills/wpf-to-winui3-migration/SKILL.md
vendored
Normal file
165
.github/skills/wpf-to-winui3-migration/SKILL.md
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
---
|
||||
name: wpf-to-winui3-migration
|
||||
description: Guide for migrating PowerToys modules from WPF to WinUI 3 (Windows App SDK). Use when asked to migrate WPF code, convert WPF XAML to WinUI, replace System.Windows namespaces with Microsoft.UI.Xaml, update Dispatcher to DispatcherQueue, replace DynamicResource with ThemeResource, migrate imaging APIs from System.Windows.Media.Imaging to Windows.Graphics.Imaging, convert WPF Window to WinUI Window, migrate .resx to .resw resources, migrate custom Observable/RelayCommand to CommunityToolkit.Mvvm source generators, handle WPF-UI (Lepo) to WinUI native control migration, or fix installer/build pipeline issues after migration. Keywords: WPF, WinUI, WinUI3, migration, porting, convert, namespace, XAML, Dispatcher, DispatcherQueue, imaging, BitmapImage, Window, ContentDialog, ThemeResource, DynamicResource, ResourceLoader, resw, resx, CommunityToolkit, ObservableProperty, WPF-UI, SizeToContent, AppWindow, SoftwareBitmap.
|
||||
license: Complete terms in LICENSE.txt
|
||||
---
|
||||
|
||||
# WPF to WinUI 3 Migration Skill
|
||||
|
||||
Migrate PowerToys modules from WPF (`System.Windows.*`) to WinUI 3 (`Microsoft.UI.Xaml.*` / Windows App SDK). Based on patterns validated in the ImageResizer module migration.
|
||||
|
||||
## When to Use This Skill
|
||||
|
||||
- Migrate a PowerToys module from WPF to WinUI 3
|
||||
- Convert WPF XAML files to WinUI 3 XAML
|
||||
- Replace `System.Windows` namespaces with `Microsoft.UI.Xaml`
|
||||
- Migrate `Dispatcher` usage to `DispatcherQueue`
|
||||
- Migrate custom `Observable`/`RelayCommand` to CommunityToolkit.Mvvm source generators
|
||||
- Replace WPF-UI (Lepo) controls with native WinUI 3 controls
|
||||
- Convert imaging code from `System.Windows.Media.Imaging` to `Windows.Graphics.Imaging`
|
||||
- Handle WPF `Window` vs WinUI `Window` differences (sizing, positioning, SizeToContent)
|
||||
- Migrate resource files from `.resx` to `.resw` with `ResourceLoader`
|
||||
- Fix installer/build pipeline issues after WinUI 3 migration
|
||||
- Update project files, NuGet packages, and signing config
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Visual Studio 2022 17.4+
|
||||
- Windows App SDK NuGet package (`Microsoft.WindowsAppSDK`)
|
||||
- .NET 8+ with `net8.0-windows10.0.19041.0` TFM
|
||||
- Windows 10 1803+ (April 2018 Update or newer)
|
||||
|
||||
## Migration Strategy
|
||||
|
||||
### Recommended Order
|
||||
|
||||
1. **Project file** — Update TFM, NuGet packages, set `<UseWinUI>true</UseWinUI>`
|
||||
2. **Data models and business logic** — No UI dependencies, migrate first
|
||||
3. **MVVM framework** — Replace custom Observable/RelayCommand with CommunityToolkit.Mvvm
|
||||
4. **Resource strings** — Migrate `.resx` → `.resw`, introduce `ResourceLoaderInstance`
|
||||
5. **Services and utilities** — Replace `System.Windows` types, async-ify imaging code
|
||||
6. **ViewModels** — Update Dispatcher usage, binding patterns
|
||||
7. **Views/Pages** — Starting from leaf pages with fewest dependencies
|
||||
8. **Main page / shell** — Last, since it depends on everything
|
||||
9. **App.xaml / startup code** — Merge carefully (do NOT overwrite WinUI 3 boilerplate)
|
||||
10. **Installer & build pipeline** — Update WiX, signing, build events
|
||||
11. **Tests** — Adapt for WinUI 3 runtime, async patterns
|
||||
|
||||
### Key Principles
|
||||
|
||||
- **Do NOT overwrite `App.xaml` / `App.xaml.cs`** — WinUI 3 has different application lifecycle boilerplate. Merge your resources and initialization code into the generated WinUI 3 App class.
|
||||
- **Do NOT create Exe→WinExe `ProjectReference`** — Extract shared code to a Library project. This causes phantom build artifacts.
|
||||
- **Use `Lazy<T>` for resource-dependent statics** — `ResourceLoader` is not available at class-load time in all contexts.
|
||||
|
||||
## Quick Reference Tables
|
||||
|
||||
### Namespace Mapping
|
||||
|
||||
| WPF | WinUI 3 |
|
||||
|-----|---------|
|
||||
| `System.Windows` | `Microsoft.UI.Xaml` |
|
||||
| `System.Windows.Controls` | `Microsoft.UI.Xaml.Controls` |
|
||||
| `System.Windows.Media` | `Microsoft.UI.Xaml.Media` |
|
||||
| `System.Windows.Media.Imaging` | `Microsoft.UI.Xaml.Media.Imaging` (UI) / `Windows.Graphics.Imaging` (processing) |
|
||||
| `System.Windows.Input` | `Microsoft.UI.Xaml.Input` |
|
||||
| `System.Windows.Data` | `Microsoft.UI.Xaml.Data` |
|
||||
| `System.Windows.Threading` | `Microsoft.UI.Dispatching` |
|
||||
| `System.Windows.Interop` | `WinRT.Interop` |
|
||||
|
||||
### Critical API Replacements
|
||||
|
||||
| WPF | WinUI 3 | Notes |
|
||||
|-----|---------|-------|
|
||||
| `Dispatcher.Invoke()` | `DispatcherQueue.TryEnqueue()` | Different return type (`bool`) |
|
||||
| `Dispatcher.CheckAccess()` | `DispatcherQueue.HasThreadAccess` | Property vs method |
|
||||
| `Application.Current.Dispatcher` | Store `DispatcherQueue` in static field | See [Threading](./references/threading-and-windowing.md) |
|
||||
| `MessageBox.Show()` | `ContentDialog` | Must set `XamlRoot` |
|
||||
| `DynamicResource` | `ThemeResource` | Theme-reactive only |
|
||||
| `clr-namespace:` | `using:` | XAML namespace prefix |
|
||||
| `{x:Static props:Resources.Key}` | `x:Uid` or `ResourceLoader.GetString()` | .resx → .resw |
|
||||
| `DataType="{x:Type m:Foo}"` | Remove or use code-behind | `x:Type` not supported |
|
||||
| `Properties.Resources.MyString` | `ResourceLoaderInstance.ResourceLoader.GetString("MyString")` | Lazy-init pattern |
|
||||
| `Application.Current.MainWindow` | Custom `App.Window` static property | Must track manually |
|
||||
| `SizeToContent="Height"` | Custom `SizeToContent()` via `AppWindow.Resize()` | See [Windowing](./references/threading-and-windowing.md) |
|
||||
| `MouseLeftButtonDown` | `PointerPressed` | Mouse → Pointer events |
|
||||
| `Pack URI (pack://...)` | `ms-appx:///` | Resource URI scheme |
|
||||
| `Observable` (custom base) | `ObservableObject` + `[ObservableProperty]` | CommunityToolkit.Mvvm |
|
||||
| `RelayCommand` (custom) | `[RelayCommand]` source generator | CommunityToolkit.Mvvm |
|
||||
| `JpegBitmapEncoder` | `BitmapEncoder.CreateAsync(JpegEncoderId, stream)` | Async, unified API |
|
||||
| `encoder.QualityLevel = 85` | `BitmapPropertySet { "ImageQuality", 0.85f }` | int 1-100 → float 0-1 |
|
||||
|
||||
### NuGet Package Migration
|
||||
|
||||
| WPF | WinUI 3 |
|
||||
|-----|---------|
|
||||
| `Microsoft.Xaml.Behaviors.Wpf` | `Microsoft.Xaml.Behaviors.WinUI.Managed` |
|
||||
| `WPF-UI` (Lepo) | Remove — use native WinUI 3 controls |
|
||||
| `CommunityToolkit.Mvvm` | `CommunityToolkit.Mvvm` (same) |
|
||||
| `Microsoft.Toolkit.Wpf.*` | `CommunityToolkit.WinUI.*` |
|
||||
| (none) | `Microsoft.WindowsAppSDK` |
|
||||
| (none) | `Microsoft.Windows.SDK.BuildTools` |
|
||||
| (none) | `WinUIEx` (optional, for window helpers) |
|
||||
| (none) | `CommunityToolkit.WinUI.Converters` |
|
||||
|
||||
### XAML Syntax Changes
|
||||
|
||||
| WPF | WinUI 3 |
|
||||
|-----|---------|
|
||||
| `xmlns:local="clr-namespace:MyApp"` | `xmlns:local="using:MyApp"` |
|
||||
| `{DynamicResource Key}` | `{ThemeResource Key}` |
|
||||
| `{x:Static Type.Member}` | `{x:Bind}` or code-behind |
|
||||
| `{x:Type local:MyType}` | Not supported |
|
||||
| `<Style.Triggers>` / `<DataTrigger>` | `VisualStateManager` |
|
||||
| `{Binding}` in `Setter.Value` | Not supported — use `StaticResource` |
|
||||
| `Content="{x:Static p:Resources.Cancel}"` | `x:Uid="Cancel"` with `.Content` in `.resw` |
|
||||
| `<ui:FluentWindow>` / `<ui:Button>` (WPF-UI) | Native `<Window>` / `<Button>` |
|
||||
| `<ui:NumberBox>` / `<ui:ProgressRing>` (WPF-UI) | Native `<NumberBox>` / `<ProgressRing>` |
|
||||
| `BasedOn="{StaticResource {x:Type ui:Button}}"` | `BasedOn="{StaticResource DefaultButtonStyle}"` |
|
||||
| `IsDefault="True"` / `IsCancel="True"` | `Style="{StaticResource AccentButtonStyle}"` / handle via KeyDown |
|
||||
| `<AccessText>` | Not available — use `AccessKey` property |
|
||||
| `<behaviors:Interaction.Triggers>` | Migrate to code-behind or WinUI behaviors |
|
||||
|
||||
## Detailed Reference Docs
|
||||
|
||||
Read only the section relevant to your current task:
|
||||
|
||||
- [Namespace and API Mapping](./references/namespace-api-mapping.md) — Full type mapping, NuGet changes, project file, CsWinRT interop
|
||||
- [XAML Migration Guide](./references/xaml-migration.md) — XAML syntax, WPF-UI removal, markup extensions, styles, resources, data binding
|
||||
- [Threading and Window Management](./references/threading-and-windowing.md) — Dispatcher, DispatcherQueue, SizeToContent, AppWindow, HWND interop, custom entry point
|
||||
- [Imaging API Migration](./references/imaging-migration.md) — BitmapEncoder/Decoder, SoftwareBitmap, CodecHelper, async patterns, int→uint
|
||||
- [PowerToys-Specific Patterns](./references/powertoys-patterns.md) — MVVM migration, ResourceLoader, Lazy init, installer, signing, test adaptation, build pipeline
|
||||
|
||||
## Common Pitfalls (from ImageResizer migration)
|
||||
|
||||
| Pitfall | Solution |
|
||||
|---------|----------|
|
||||
| `ContentDialog` throws "does not have a XamlRoot" | Set `dialog.XamlRoot = this.Content.XamlRoot` before `ShowAsync()` |
|
||||
| `FilePicker` throws error in desktop app | Call `WinRT.Interop.InitializeWithWindow.Initialize(picker, hwnd)` |
|
||||
| `Window.Dispatcher` returns null | Use `Window.DispatcherQueue` instead |
|
||||
| Resources on `Window` element not found | Move resources to root layout container (`Grid.Resources`) |
|
||||
| `VisualStateManager` on `Window` fails | Use `UserControl` or `Page` inside the Window |
|
||||
| Satellite assembly installer errors (`WIX0103`) | Remove `.resources.dll` refs from `Resources.wxs`; WinUI 3 uses `.pri` |
|
||||
| Phantom `.exe`/`.deps.json` in root output dir | Avoid Exe→WinExe `ProjectReference`; use Library project |
|
||||
| `ResourceLoader` crash at static init | Wrap in `Lazy<T>` or null-coalescing property — see [Lazy Init](./references/powertoys-patterns.md#lazy-initialization-for-resource-dependent-statics) |
|
||||
| `SizeToContent` not available | Implement manual content measurement + `AppWindow.Resize()` with DPI scaling |
|
||||
| `x:Bind` default mode is `OneTime` | Explicitly set `Mode=OneWay` or `Mode=TwoWay` |
|
||||
| `DynamicResource` / `x:Static` not compiling | Replace with `ThemeResource` / `ResourceLoader` or `x:Uid` |
|
||||
| `IValueConverter.Convert` signature mismatch | Last param: `CultureInfo` → `string` (language tag) |
|
||||
| Test project can't resolve WPF types | Add `<UseWPF>true</UseWPF>` temporarily; remove after imaging migration |
|
||||
| Pixel dimension type mismatch (`int` vs `uint`) | WinRT uses `uint` for pixel sizes — add `u` suffix in test assertions |
|
||||
| `$(SolutionDir)` empty in standalone project build | Use `$(MSBuildThisFileDirectory)` with relative paths instead |
|
||||
| JPEG quality value wrong after migration | WPF: int 1-100; WinRT: float 0.0-1.0 |
|
||||
| MSIX packaging fails in PreBuildEvent | Move to PostBuildEvent; artifacts not ready at PreBuild time |
|
||||
| RC file icon path with forward slashes | Use double-backslash escaping: `..\\ui\\Assets\\icon.ico` |
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
| Issue | Solution |
|
||||
|-------|----------|
|
||||
| Build fails after namespace rename | Check for lingering `System.Windows` usings; some types have no direct equivalent |
|
||||
| Missing `PresentationCore.dll` at runtime | Ensure ALL imaging code uses `Windows.Graphics.Imaging`, not `System.Windows.Media.Imaging` |
|
||||
| `DataContext` not working on Window | WinUI 3 `Window` is not a `DependencyObject`; use a root `Page` or `UserControl` |
|
||||
| XAML designer not available | WinUI 3 does not support XAML Designer; use Hot Reload instead |
|
||||
| NuGet restore failures | Run `build-essentials.cmd` after adding `Microsoft.WindowsAppSDK` package |
|
||||
| `Parallel.ForEach` compilation error | Migrate to `Parallel.ForEachAsync` for async imaging operations |
|
||||
| Signing check fails on leaked artifacts | Run `generateAllFileComponents.ps1`; verify only `WinUI3Apps\\` paths in signing config |
|
||||
287
.github/skills/wpf-to-winui3-migration/references/imaging-migration.md
vendored
Normal file
287
.github/skills/wpf-to-winui3-migration/references/imaging-migration.md
vendored
Normal file
@@ -0,0 +1,287 @@
|
||||
# Imaging API Migration
|
||||
|
||||
Migrating from WPF (`System.Windows.Media.Imaging` / `PresentationCore.dll`) to WinRT (`Windows.Graphics.Imaging`). Based on the ImageResizer migration.
|
||||
|
||||
## Why This Migration Is Required
|
||||
|
||||
WinUI 3 apps deployed as self-contained do NOT include `PresentationCore.dll`. Any code using `System.Windows.Media.Imaging` will throw `FileNotFoundException` at runtime. ALL imaging code must use WinRT APIs.
|
||||
|
||||
| Purpose | Namespace |
|
||||
|---------|-----------|
|
||||
| UI display (`Image.Source`) | `Microsoft.UI.Xaml.Media.Imaging` |
|
||||
| Image processing (encode/decode/transform) | `Windows.Graphics.Imaging` |
|
||||
|
||||
## Architecture Change: Pipeline vs Declarative
|
||||
|
||||
The fundamental architecture differs:
|
||||
|
||||
**WPF**: In-memory pipeline of bitmap objects. Decode → transform → encode synchronously.
|
||||
```csharp
|
||||
var decoder = BitmapDecoder.Create(stream, ...);
|
||||
var transform = new TransformedBitmap(decoder.Frames[0], new ScaleTransform(...));
|
||||
var encoder = new JpegBitmapEncoder();
|
||||
encoder.Frames.Add(BitmapFrame.Create(transform, ...));
|
||||
encoder.Save(outputStream);
|
||||
```
|
||||
|
||||
**WinRT**: Declarative transform model. Configure transforms on the encoder, which handles pixel manipulation internally. All async.
|
||||
```csharp
|
||||
var decoder = await BitmapDecoder.CreateAsync(winrtStream);
|
||||
var encoder = await BitmapEncoder.CreateForTranscodingAsync(outputStream, decoder);
|
||||
encoder.BitmapTransform.ScaledWidth = newWidth;
|
||||
encoder.BitmapTransform.ScaledHeight = newHeight;
|
||||
encoder.BitmapTransform.InterpolationMode = BitmapInterpolationMode.Fant;
|
||||
await encoder.FlushAsync();
|
||||
```
|
||||
|
||||
## Core Type Mapping
|
||||
|
||||
### Decoders
|
||||
|
||||
| WPF | WinRT | Notes |
|
||||
|-----|-------|-------|
|
||||
| `BitmapDecoder.Create(stream, options, cache)` | `BitmapDecoder.CreateAsync(stream)` | Async, auto-detects format |
|
||||
| `JpegBitmapDecoder` / `PngBitmapDecoder` / etc. | `BitmapDecoder.CreateAsync(stream)` | Single unified decoder |
|
||||
| `decoder.Frames[0]` | `await decoder.GetFrameAsync(0)` | Async frame access |
|
||||
| `decoder.Frames.Count` | `decoder.FrameCount` (uint) | `int` → `uint` |
|
||||
| `decoder.CodecInfo.ContainerFormat` | `decoder.DecoderInformation.CodecId` | Different property path |
|
||||
| `decoder.Frames[0].PixelWidth` (int) | `decoder.PixelWidth` (uint) | `int` → `uint` |
|
||||
| `WmpBitmapDecoder` | Not available | WMP/HDP not supported |
|
||||
|
||||
### Encoders
|
||||
|
||||
| WPF | WinRT | Notes |
|
||||
|-----|-------|-------|
|
||||
| `new JpegBitmapEncoder()` | `BitmapEncoder.CreateAsync(BitmapEncoder.JpegEncoderId, stream)` | Async factory |
|
||||
| `new PngBitmapEncoder()` | `BitmapEncoder.CreateAsync(BitmapEncoder.PngEncoderId, stream)` | No interlace control |
|
||||
| `encoder.Frames.Add(frame)` | `encoder.SetSoftwareBitmap(bitmap)` | Different API |
|
||||
| `encoder.Save(stream)` | `await encoder.FlushAsync()` | Async |
|
||||
|
||||
### Encoder Properties (Strongly-Typed → BitmapPropertySet)
|
||||
|
||||
WPF had type-specific encoder subclasses. WinRT uses a generic property set:
|
||||
|
||||
```csharp
|
||||
// WPF
|
||||
case JpegBitmapEncoder jpeg: jpeg.QualityLevel = 85; // int 1-100
|
||||
case PngBitmapEncoder png: png.Interlace = PngInterlaceOption.On;
|
||||
case TiffBitmapEncoder tiff: tiff.Compression = TiffCompressOption.Lzw;
|
||||
|
||||
// WinRT — JPEG quality (float 0.0-1.0)
|
||||
await encoder.BitmapProperties.SetPropertiesAsync(new BitmapPropertySet
|
||||
{
|
||||
{ "ImageQuality", new BitmapTypedValue(0.85f, PropertyType.Single) }
|
||||
});
|
||||
|
||||
// WinRT — TIFF compression (via BitmapPropertySet at creation time)
|
||||
var props = new BitmapPropertySet
|
||||
{
|
||||
{ "TiffCompressionMethod", new BitmapTypedValue((byte)2, PropertyType.UInt8) }
|
||||
};
|
||||
var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.TiffEncoderId, stream, props);
|
||||
```
|
||||
|
||||
**JPEG quality scale change**: WPF int `1-100` → WinRT float `0.0-1.0`. Divide by 100.
|
||||
|
||||
### Bitmap Types
|
||||
|
||||
| WPF | WinRT | Notes |
|
||||
|-----|-------|-------|
|
||||
| `BitmapSource` | `SoftwareBitmap` | Central pixel-data type |
|
||||
| `BitmapImage` | `BitmapImage` (in `Microsoft.UI.Xaml.Media.Imaging`) | UI display only |
|
||||
| `FormatConvertedBitmap` | `SoftwareBitmap.Convert()` | |
|
||||
| `TransformedBitmap` + `ScaleTransform` | `BitmapTransform` via encoder | Declarative |
|
||||
| `CroppedBitmap` | `BitmapTransform.Bounds` | |
|
||||
|
||||
### Metadata
|
||||
|
||||
| WPF | WinRT | Notes |
|
||||
|-----|-------|-------|
|
||||
| `BitmapMetadata` | `BitmapProperties` | Different API surface |
|
||||
| `BitmapMetadata.Clone()` | No equivalent | Cannot selectively clone |
|
||||
| Selective metadata removal | Not supported | All-or-nothing only |
|
||||
|
||||
**Two encoder creation strategies for metadata:**
|
||||
- `CreateForTranscodingAsync()` — preserves ALL metadata from source
|
||||
- `CreateAsync()` — creates fresh encoder with NO metadata
|
||||
|
||||
This eliminated ~258 lines of manual metadata manipulation code (`BitmapMetadataExtension.cs`) in ImageResizer.
|
||||
|
||||
### Interpolation Modes
|
||||
|
||||
| WPF `BitmapScalingMode` | WinRT `BitmapInterpolationMode` |
|
||||
|------------------------|-------------------------------|
|
||||
| `HighQuality` / `Fant` | `Fant` |
|
||||
| `Linear` | `Linear` |
|
||||
| `NearestNeighbor` | `NearestNeighbor` |
|
||||
| `Unspecified` / `LowQuality` | `Linear` |
|
||||
|
||||
## Stream Interop
|
||||
|
||||
WinRT imaging requires `IRandomAccessStream` instead of `System.IO.Stream`:
|
||||
|
||||
```csharp
|
||||
using var stream = File.OpenRead(path);
|
||||
var winrtStream = stream.AsRandomAccessStream(); // Extension method
|
||||
var decoder = await BitmapDecoder.CreateAsync(winrtStream);
|
||||
```
|
||||
|
||||
**Critical**: For transcode, seek the input stream back to 0 before creating the encoder:
|
||||
```csharp
|
||||
winrtStream.Seek(0);
|
||||
var encoder = await BitmapEncoder.CreateForTranscodingAsync(outputStream, decoder);
|
||||
```
|
||||
|
||||
## CodecHelper Pattern (from ImageResizer)
|
||||
|
||||
WPF stored container format GUIDs in `settings.json`. WinRT uses different codec IDs. Create a `CodecHelper` to bridge them:
|
||||
|
||||
```csharp
|
||||
internal static class CodecHelper
|
||||
{
|
||||
// Maps WPF container format GUIDs (stored in settings JSON) to WinRT encoder IDs
|
||||
private static readonly Dictionary<Guid, Guid> LegacyGuidToEncoderId = new()
|
||||
{
|
||||
[new Guid("19e4a5aa-5662-4fc5-a0c0-1758028e1057")] = BitmapEncoder.JpegEncoderId,
|
||||
[new Guid("1b7cfaf4-713f-473c-bbcd-6137425faeaf")] = BitmapEncoder.PngEncoderId,
|
||||
[new Guid("0af1d87e-fcfe-4188-bdeb-a7906471cbe3")] = BitmapEncoder.BmpEncoderId,
|
||||
[new Guid("163bcc30-e2e9-4f0b-961d-a3e9fdb788a3")] = BitmapEncoder.TiffEncoderId,
|
||||
[new Guid("1f8a5601-7d4d-4cbd-9c82-1bc8d4eeb9a5")] = BitmapEncoder.GifEncoderId,
|
||||
};
|
||||
|
||||
// Maps decoder IDs to corresponding encoder IDs
|
||||
private static readonly Dictionary<Guid, Guid> DecoderIdToEncoderId = new()
|
||||
{
|
||||
[BitmapDecoder.JpegDecoderId] = BitmapEncoder.JpegEncoderId,
|
||||
[BitmapDecoder.PngDecoderId] = BitmapEncoder.PngEncoderId,
|
||||
// ...
|
||||
};
|
||||
|
||||
public static Guid GetEncoderIdFromLegacyGuid(Guid legacyGuid)
|
||||
=> LegacyGuidToEncoderId.GetValueOrDefault(legacyGuid, Guid.Empty);
|
||||
|
||||
public static Guid GetEncoderIdForDecoder(BitmapDecoder decoder)
|
||||
=> DecoderIdToEncoderId.GetValueOrDefault(decoder.DecoderInformation.CodecId, Guid.Empty);
|
||||
}
|
||||
```
|
||||
|
||||
This preserves backward compatibility with existing `settings.json` files that contain WPF-era GUIDs.
|
||||
|
||||
## ImagingEnums Pattern (from ImageResizer)
|
||||
|
||||
WPF-specific enums (`PngInterlaceOption`, `TiffCompressOption`) from `System.Windows.Media.Imaging` are used in settings JSON. Create custom enums with identical integer values for backward-compatible deserialization:
|
||||
|
||||
```csharp
|
||||
// Replace System.Windows.Media.Imaging.PngInterlaceOption
|
||||
public enum PngInterlaceOption { Default = 0, On = 1, Off = 2 }
|
||||
|
||||
// Replace System.Windows.Media.Imaging.TiffCompressOption
|
||||
public enum TiffCompressOption { Default = 0, None = 1, Ccitt3 = 2, Ccitt4 = 3, Lzw = 4, Rle = 5, Zip = 6 }
|
||||
```
|
||||
|
||||
## Async Migration Patterns
|
||||
|
||||
### Method Signatures
|
||||
|
||||
All imaging operations become async:
|
||||
|
||||
| Before | After |
|
||||
|--------|-------|
|
||||
| `void Execute(file, settings)` | `async Task ExecuteAsync(file, settings)` |
|
||||
| `IEnumerable<Error> Process()` | `async Task<IEnumerable<Error>> ProcessAsync()` |
|
||||
|
||||
### Parallel Processing
|
||||
|
||||
```csharp
|
||||
// WPF (synchronous)
|
||||
Parallel.ForEach(Files, new ParallelOptions { MaxDegreeOfParallelism = ... },
|
||||
(file, state, i) => { Execute(file, settings); });
|
||||
|
||||
// WinRT (async)
|
||||
await Parallel.ForEachAsync(Files, new ParallelOptions { MaxDegreeOfParallelism = ... },
|
||||
async (file, ct) => { await ExecuteAsync(file, settings); });
|
||||
```
|
||||
|
||||
### CLI Async Bridge
|
||||
|
||||
CLI entry points must bridge async to sync:
|
||||
```csharp
|
||||
return RunSilentModeAsync(cliOptions).GetAwaiter().GetResult();
|
||||
```
|
||||
|
||||
### Task.Factory.StartNew → Task.Run
|
||||
|
||||
```csharp
|
||||
// WPF
|
||||
_ = Task.Factory.StartNew(StartExecutingWork, token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
|
||||
|
||||
// WinUI 3
|
||||
_ = Task.Run(() => StartExecutingWorkAsync());
|
||||
```
|
||||
|
||||
## SoftwareBitmap as Interface Type
|
||||
|
||||
When modules expose imaging interfaces (e.g., AI super-resolution), change parameter/return types:
|
||||
|
||||
```csharp
|
||||
// WPF
|
||||
BitmapSource ApplySuperResolution(BitmapSource source, int scale, string filePath);
|
||||
|
||||
// WinRT
|
||||
SoftwareBitmap ApplySuperResolution(SoftwareBitmap source, int scale, string filePath);
|
||||
```
|
||||
|
||||
This eliminates manual `BitmapSource ↔ SoftwareBitmap` conversion code (unsafe `IMemoryBufferByteAccess` COM interop).
|
||||
|
||||
## MultiFrame Image Handling
|
||||
|
||||
```csharp
|
||||
// WinRT multi-frame encode (e.g., multi-page TIFF, animated GIF)
|
||||
for (uint i = 0; i < decoder.FrameCount; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
await encoder.GoToNextFrameAsync();
|
||||
|
||||
var frame = await decoder.GetFrameAsync(i);
|
||||
var bitmap = await frame.GetSoftwareBitmapAsync(
|
||||
frame.BitmapPixelFormat,
|
||||
BitmapAlphaMode.Premultiplied,
|
||||
transform,
|
||||
ExifOrientationMode.IgnoreExifOrientation,
|
||||
ColorManagementMode.DoNotColorManage);
|
||||
encoder.SetSoftwareBitmap(bitmap);
|
||||
}
|
||||
await encoder.FlushAsync();
|
||||
```
|
||||
|
||||
## int → uint for Pixel Dimensions
|
||||
|
||||
WinRT uses `uint` for all pixel dimensions. This affects:
|
||||
- `decoder.PixelWidth` / `decoder.PixelHeight` — `uint`
|
||||
- `BitmapTransform.ScaledWidth` / `ScaledHeight` — `uint`
|
||||
- `SoftwareBitmap` constructor — `uint` parameters
|
||||
- Test assertions: `Assert.AreEqual(96, ...)` → `Assert.AreEqual(96u, ...)`
|
||||
|
||||
## Display SoftwareBitmap in UI
|
||||
|
||||
```csharp
|
||||
var source = new SoftwareBitmapSource();
|
||||
// Must convert to Bgra8/Premultiplied for display
|
||||
if (bitmap.BitmapPixelFormat != BitmapPixelFormat.Bgra8 ||
|
||||
bitmap.BitmapAlphaMode != BitmapAlphaMode.Premultiplied)
|
||||
{
|
||||
bitmap = SoftwareBitmap.Convert(bitmap, BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);
|
||||
}
|
||||
await source.SetBitmapAsync(bitmap);
|
||||
myImage.Source = source;
|
||||
```
|
||||
|
||||
## Known Limitations
|
||||
|
||||
| Feature | WPF | WinRT | Impact |
|
||||
|---------|-----|-------|--------|
|
||||
| PNG interlace | `PngBitmapEncoder.Interlace` | Not available | Always non-interlaced |
|
||||
| Metadata stripping | Selective via `BitmapMetadata.Clone()` | All-or-nothing | Orientation EXIF also removed |
|
||||
| Pixel formats | Many (`Pbgra32`, `Bgr24`, `Indexed8`, ...) | Primarily `Bgra8`, `Rgba8`, `Gray8/16` | Convert to `Bgra8` |
|
||||
| WMP/HDP format | `WmpBitmapDecoder` | Not available | Not supported |
|
||||
| Pixel differences | WPF scaler | `BitmapInterpolationMode.Fant` | Not bit-identical |
|
||||
226
.github/skills/wpf-to-winui3-migration/references/namespace-api-mapping.md
vendored
Normal file
226
.github/skills/wpf-to-winui3-migration/references/namespace-api-mapping.md
vendored
Normal file
@@ -0,0 +1,226 @@
|
||||
# Namespace and API Mapping Reference
|
||||
|
||||
Complete reference for mapping WPF types to WinUI 3 equivalents, based on the ImageResizer migration.
|
||||
|
||||
## Root Namespace Mapping
|
||||
|
||||
| WPF Namespace | WinUI 3 Namespace |
|
||||
|---------------|-------------------|
|
||||
| `System.Windows` | `Microsoft.UI.Xaml` |
|
||||
| `System.Windows.Automation` | `Microsoft.UI.Xaml.Automation` |
|
||||
| `System.Windows.Automation.Peers` | `Microsoft.UI.Xaml.Automation.Peers` |
|
||||
| `System.Windows.Controls` | `Microsoft.UI.Xaml.Controls` |
|
||||
| `System.Windows.Controls.Primitives` | `Microsoft.UI.Xaml.Controls.Primitives` |
|
||||
| `System.Windows.Data` | `Microsoft.UI.Xaml.Data` |
|
||||
| `System.Windows.Documents` | `Microsoft.UI.Xaml.Documents` |
|
||||
| `System.Windows.Input` | `Microsoft.UI.Xaml.Input` |
|
||||
| `System.Windows.Markup` | `Microsoft.UI.Xaml.Markup` |
|
||||
| `System.Windows.Media` | `Microsoft.UI.Xaml.Media` |
|
||||
| `System.Windows.Media.Animation` | `Microsoft.UI.Xaml.Media.Animation` |
|
||||
| `System.Windows.Media.Imaging` | `Microsoft.UI.Xaml.Media.Imaging` |
|
||||
| `System.Windows.Navigation` | `Microsoft.UI.Xaml.Navigation` |
|
||||
| `System.Windows.Shapes` | `Microsoft.UI.Xaml.Shapes` |
|
||||
| `System.Windows.Threading` | `Microsoft.UI.Dispatching` |
|
||||
| `System.Windows.Interop` | `WinRT.Interop` |
|
||||
|
||||
## Core Type Mapping
|
||||
|
||||
| WPF Type | WinUI 3 Type |
|
||||
|----------|-------------|
|
||||
| `System.Windows.Application` | `Microsoft.UI.Xaml.Application` |
|
||||
| `System.Windows.Window` | `Microsoft.UI.Xaml.Window` (NOT a DependencyObject) |
|
||||
| `System.Windows.DependencyObject` | `Microsoft.UI.Xaml.DependencyObject` |
|
||||
| `System.Windows.DependencyProperty` | `Microsoft.UI.Xaml.DependencyProperty` |
|
||||
| `System.Windows.FrameworkElement` | `Microsoft.UI.Xaml.FrameworkElement` |
|
||||
| `System.Windows.UIElement` | `Microsoft.UI.Xaml.UIElement` |
|
||||
| `System.Windows.Visibility` | `Microsoft.UI.Xaml.Visibility` |
|
||||
| `System.Windows.Thickness` | `Microsoft.UI.Xaml.Thickness` |
|
||||
| `System.Windows.CornerRadius` | `Microsoft.UI.Xaml.CornerRadius` |
|
||||
| `System.Windows.Media.Color` | `Windows.UI.Color` (note: `Windows.UI`, not `Microsoft.UI`) |
|
||||
| `System.Windows.Media.Colors` | `Microsoft.UI.Colors` |
|
||||
|
||||
## Controls Mapping
|
||||
|
||||
### Direct Mapping (namespace-only change)
|
||||
|
||||
These controls exist in both frameworks with the same name — change `System.Windows.Controls` to `Microsoft.UI.Xaml.Controls`:
|
||||
|
||||
`Button`, `TextBox`, `TextBlock`, `ComboBox`, `CheckBox`, `ListBox`, `ListView`, `Image`, `StackPanel`, `Grid`, `Border`, `ScrollViewer`, `ContentControl`, `UserControl`, `Page`, `Frame`, `Slider`, `ProgressBar`, `ToolTip`, `RadioButton`, `ToggleButton`
|
||||
|
||||
### Controls With Different Names or Behavior
|
||||
|
||||
| WPF | WinUI 3 | Notes |
|
||||
|-----|---------|-------|
|
||||
| `MessageBox` | `ContentDialog` | Must set `XamlRoot` before `ShowAsync()` |
|
||||
| `ContextMenu` | `MenuFlyout` | Different API surface |
|
||||
| `TabControl` | `TabView` | Different API |
|
||||
| `Menu` | `MenuBar` | Different API |
|
||||
| `StatusBar` | Custom `StackPanel` layout | No built-in equivalent |
|
||||
| `AccessText` | Not available | Use `AccessKey` property on target control |
|
||||
|
||||
### WPF-UI (Lepo) to Native WinUI 3
|
||||
|
||||
ImageResizer used the `WPF-UI` library (Lepo) for Fluent styling. These must be replaced with native WinUI 3 equivalents:
|
||||
|
||||
| WPF-UI (Lepo) | WinUI 3 Native | Notes |
|
||||
|----------------|---------------|-------|
|
||||
| `<ui:FluentWindow>` | `<Window>` | Native window + `ExtendsContentIntoTitleBar` |
|
||||
| `<ui:Button>` | `<Button>` | Native button |
|
||||
| `<ui:NumberBox>` | `<NumberBox>` | Built into WinUI 3 |
|
||||
| `<ui:ProgressRing>` | `<ProgressRing>` | Built into WinUI 3 |
|
||||
| `<ui:SymbolIcon>` | `<SymbolIcon>` or `<FontIcon>` | Built into WinUI 3 |
|
||||
| `<ui:InfoBar>` | `<InfoBar>` | Built into WinUI 3 |
|
||||
| `<ui:TitleBar>` | Custom title bar via `SetTitleBar()` | Use `ExtendsContentIntoTitleBar` |
|
||||
| `<ui:ThemesDictionary>` | `<XamlControlsResources>` | In merged dictionaries |
|
||||
| `<ui:ControlsDictionary>` | Remove | Not needed — WinUI 3 has its own control styles |
|
||||
| `BasedOn="{StaticResource {x:Type ui:Button}}"` | `BasedOn="{StaticResource DefaultButtonStyle}"` | Named style keys |
|
||||
|
||||
## Input Event Mapping
|
||||
|
||||
| WPF Event | WinUI 3 Event | Notes |
|
||||
|-----------|--------------|-------|
|
||||
| `MouseLeftButtonDown` | `PointerPressed` | Check `IsLeftButtonPressed` on args |
|
||||
| `MouseLeftButtonUp` | `PointerReleased` | Check pointer properties |
|
||||
| `MouseRightButtonDown` | `RightTapped` | Or `PointerPressed` with right button check |
|
||||
| `MouseMove` | `PointerMoved` | Uses `PointerRoutedEventArgs` |
|
||||
| `MouseWheel` | `PointerWheelChanged` | Different event args |
|
||||
| `MouseEnter` | `PointerEntered` | |
|
||||
| `MouseLeave` | `PointerExited` | |
|
||||
| `MouseDoubleClick` | `DoubleTapped` | Different event args |
|
||||
| `KeyDown` | `KeyDown` | Same name, args type: `KeyRoutedEventArgs` |
|
||||
| `PreviewKeyDown` | No direct equivalent | Use `KeyDown` with handled pattern |
|
||||
|
||||
## IValueConverter Signature Change
|
||||
|
||||
| WPF | WinUI 3 |
|
||||
|-----|---------|
|
||||
| `Convert(object value, Type targetType, object parameter, CultureInfo culture)` | `Convert(object value, Type targetType, object parameter, string language)` |
|
||||
| `ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)` | `ConvertBack(object value, Type targetType, object parameter, string language)` |
|
||||
|
||||
Last parameter changes from `CultureInfo` to `string` (BCP-47 language tag). All converter classes must be updated.
|
||||
|
||||
## Types That Moved to Different Hierarchies
|
||||
|
||||
| WPF | WinUI 3 | Notes |
|
||||
|-----|---------|-------|
|
||||
| `System.Windows.Threading.Dispatcher` | `Microsoft.UI.Dispatching.DispatcherQueue` | Completely different API |
|
||||
| `System.Windows.Threading.DispatcherPriority` | `Microsoft.UI.Dispatching.DispatcherQueuePriority` | Only 3 levels: High/Normal/Low |
|
||||
| `System.Windows.Interop.HwndSource` | `WinRT.Interop.WindowNative` | For HWND interop |
|
||||
| `System.Windows.Interop.WindowInteropHelper` | `WinRT.Interop.WindowNative.GetWindowHandle()` | |
|
||||
| `System.Windows.SystemColors` | Resource keys via `ThemeResource` | No direct static class |
|
||||
| `System.Windows.SystemParameters` | Win32 API or `DisplayInformation` | No direct equivalent |
|
||||
|
||||
## NuGet Package Migration
|
||||
|
||||
| WPF | WinUI 3 | Notes |
|
||||
|-----|---------|-------|
|
||||
| Built into .NET (no NuGet needed) | `Microsoft.WindowsAppSDK` | Required |
|
||||
| `PresentationCore` / `PresentationFramework` | `Microsoft.WinUI` (transitive) | |
|
||||
| `Microsoft.Xaml.Behaviors.Wpf` | `Microsoft.Xaml.Behaviors.WinUI.Managed` | |
|
||||
| `WPF-UI` (Lepo) | **Remove** — use native WinUI 3 controls | |
|
||||
| `CommunityToolkit.Mvvm` | `CommunityToolkit.Mvvm` (same) | |
|
||||
| `Microsoft.Toolkit.Wpf.*` | `CommunityToolkit.WinUI.*` | |
|
||||
| (none) | `Microsoft.Windows.SDK.BuildTools` | Required |
|
||||
| (none) | `WinUIEx` | Optional, window helpers |
|
||||
| (none) | `CommunityToolkit.WinUI.Converters` | Optional |
|
||||
| (none) | `CommunityToolkit.WinUI.Extensions` | Optional |
|
||||
| (none) | `Microsoft.Web.WebView2` | If using WebView |
|
||||
|
||||
## Project File Changes
|
||||
|
||||
### WPF .csproj
|
||||
|
||||
```xml
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ApplicationManifest>ImageResizerUI.dev.manifest</ApplicationManifest>
|
||||
<ApplicationIcon>Resources\ImageResizer.ico</ApplicationIcon>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
```
|
||||
|
||||
### WinUI 3 .csproj
|
||||
|
||||
```xml
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||
<UseWinUI>true</UseWinUI>
|
||||
<SelfContained>true</SelfContained>
|
||||
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
|
||||
<WindowsPackageType>None</WindowsPackageType>
|
||||
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<ApplicationIcon>Assets\ImageResizer\ImageResizer.ico</ApplicationIcon>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<DefineConstants>DISABLE_XAML_GENERATED_MAIN,TRACE</DefineConstants>
|
||||
<ProjectPriFileName>PowerToys.ModuleName.pri</ProjectPriFileName>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
```
|
||||
|
||||
Key changes:
|
||||
- `UseWPF` → `UseWinUI`
|
||||
- TFM: `net8.0-windows` → `net8.0-windows10.0.19041.0`
|
||||
- Add `WindowsPackageType=None` for unpackaged desktop apps
|
||||
- Add `SelfContained=true` + `WindowsAppSDKSelfContained=true`
|
||||
- Add `DISABLE_XAML_GENERATED_MAIN` if using custom `Program.cs` entry point
|
||||
- Set `ProjectPriFileName` to match your module's assembly name
|
||||
- Move icon from `Resources/` to `Assets/<Module>/`
|
||||
|
||||
### XAML ApplicationDefinition Setup
|
||||
|
||||
WinUI 3 requires explicit `ApplicationDefinition` declaration:
|
||||
|
||||
```xml
|
||||
<ItemGroup>
|
||||
<Page Remove="ImageResizerXAML\App.xaml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="ImageResizerXAML\App.xaml" />
|
||||
</ItemGroup>
|
||||
```
|
||||
|
||||
### CsWinRT Interop (for GPO and native references)
|
||||
|
||||
If the module references native C++ projects (like `GPOWrapper`):
|
||||
|
||||
```xml
|
||||
<PropertyGroup>
|
||||
<CsWinRTIncludes>PowerToys.GPOWrapper</CsWinRTIncludes>
|
||||
<CsWinRTGeneratedFilesDir>$(OutDir)</CsWinRTGeneratedFilesDir>
|
||||
</PropertyGroup>
|
||||
```
|
||||
|
||||
Change `GPOWrapperProjection.csproj` reference to direct `GPOWrapper.vcxproj` reference.
|
||||
|
||||
### InternalsVisibleTo Migration
|
||||
|
||||
Move from code file to `.csproj`:
|
||||
|
||||
```csharp
|
||||
// DELETE: Properties/InternalsVisibleTo.cs
|
||||
// [assembly: InternalsVisibleTo("ImageResizer.Test")]
|
||||
```
|
||||
|
||||
```xml
|
||||
<!-- ADD to .csproj: -->
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="ImageResizer.Test" />
|
||||
</ItemGroup>
|
||||
```
|
||||
|
||||
### Items to Remove from .csproj
|
||||
|
||||
```xml
|
||||
<!-- DELETE: WPF resource embedding -->
|
||||
<EmbeddedResource Update="Properties\Resources.resx">...</EmbeddedResource>
|
||||
<Resource Include="Resources\ImageResizer.ico" />
|
||||
<Compile Update="Properties\Resources.Designer.cs">...</Compile>
|
||||
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WPF" /> <!-- from CLI project -->
|
||||
```
|
||||
516
.github/skills/wpf-to-winui3-migration/references/powertoys-patterns.md
vendored
Normal file
516
.github/skills/wpf-to-winui3-migration/references/powertoys-patterns.md
vendored
Normal file
@@ -0,0 +1,516 @@
|
||||
# PowerToys-Specific Migration Patterns
|
||||
|
||||
Patterns and conventions specific to the PowerToys codebase, based on the ImageResizer migration.
|
||||
|
||||
## Project Structure
|
||||
|
||||
### Before (WPF Module)
|
||||
|
||||
```
|
||||
src/modules/<module>/
|
||||
├── <Module>UI/
|
||||
│ ├── <Module>UI.csproj # OutputType=WinExe, UseWPF=true
|
||||
│ ├── App.xaml / App.xaml.cs
|
||||
│ ├── MainWindow.xaml / .cs
|
||||
│ ├── Views/
|
||||
│ ├── ViewModels/
|
||||
│ ├── Helpers/
|
||||
│ │ ├── Observable.cs # Custom INotifyPropertyChanged
|
||||
│ │ └── RelayCommand.cs # Custom ICommand
|
||||
│ ├── Properties/
|
||||
│ │ ├── Resources.resx # WPF resource strings
|
||||
│ │ ├── Resources.Designer.cs
|
||||
│ │ └── InternalsVisibleTo.cs
|
||||
│ └── Telemetry/
|
||||
├── <Module>CLI/
|
||||
│ └── <Module>CLI.csproj # OutputType=Exe
|
||||
└── tests/
|
||||
```
|
||||
|
||||
### After (WinUI 3 Module)
|
||||
|
||||
```
|
||||
src/modules/<module>/
|
||||
├── <Module>UI/
|
||||
│ ├── <Module>UI.csproj # OutputType=WinExe, UseWinUI=true
|
||||
│ ├── Program.cs # Custom entry point (DISABLE_XAML_GENERATED_MAIN)
|
||||
│ ├── app.manifest # Single manifest file
|
||||
│ ├── ImageResizerXAML/
|
||||
│ │ ├── App.xaml / App.xaml.cs # WinUI 3 App class
|
||||
│ │ ├── MainWindow.xaml / .cs
|
||||
│ │ └── Views/
|
||||
│ ├── Converters/ # WinUI 3 IValueConverter (string language)
|
||||
│ ├── ViewModels/
|
||||
│ ├── Helpers/
|
||||
│ │ └── ResourceLoaderInstance.cs # Static ResourceLoader accessor
|
||||
│ ├── Utilities/
|
||||
│ │ └── CodecHelper.cs # WPF→WinRT codec ID mapping (if imaging)
|
||||
│ ├── Models/
|
||||
│ │ └── ImagingEnums.cs # Custom enums replacing WPF imaging enums
|
||||
│ ├── Strings/
|
||||
│ │ └── en-us/
|
||||
│ │ └── Resources.resw # WinUI 3 resource strings
|
||||
│ └── Assets/
|
||||
│ └── <Module>/
|
||||
│ └── <Module>.ico # Moved from Resources/
|
||||
├── <Module>Common/ # NEW: shared library for CLI
|
||||
│ └── <Module>Common.csproj # OutputType=Library
|
||||
├── <Module>CLI/
|
||||
│ └── <Module>CLI.csproj # References Common, NOT UI
|
||||
└── tests/
|
||||
```
|
||||
|
||||
### Critical: CLI Dependency Pattern
|
||||
|
||||
**Do NOT** create `ProjectReference` from Exe to WinExe. This causes phantom build artifacts (`.exe`, `.deps.json`, `.runtimeconfig.json`) in the root output directory.
|
||||
|
||||
```
|
||||
WRONG: ImageResizerCLI (Exe) → ImageResizerUI (WinExe) ← phantom artifacts
|
||||
CORRECT: ImageResizerCLI (Exe) → ImageResizerCommon (Library)
|
||||
ImageResizerUI (WinExe) → ImageResizerCommon (Library)
|
||||
```
|
||||
|
||||
Follow the `FancyZonesCLI` → `FancyZonesEditorCommon` pattern.
|
||||
|
||||
### Files to Delete
|
||||
|
||||
| File | Reason |
|
||||
|------|--------|
|
||||
| `Properties/Resources.resx` | Replaced by `Strings/en-us/Resources.resw` |
|
||||
| `Properties/Resources.Designer.cs` | Auto-generated; no longer needed |
|
||||
| `Properties/InternalsVisibleTo.cs` | Moved to `.csproj` `<InternalsVisibleTo>` |
|
||||
| `Helpers/Observable.cs` | Replaced by `CommunityToolkit.Mvvm.ObservableObject` |
|
||||
| `Helpers/RelayCommand.cs` | Replaced by `CommunityToolkit.Mvvm.Input` |
|
||||
| `Resources/*.ico` / `Resources/*.png` | Moved to `Assets/<Module>/` |
|
||||
| WPF `.dev.manifest` / `.prod.manifest` | Replaced by single `app.manifest` |
|
||||
| WPF-specific converters | Replaced by WinUI 3 converters with `string language` |
|
||||
|
||||
---
|
||||
|
||||
## MVVM Migration: Custom → CommunityToolkit.Mvvm Source Generators
|
||||
|
||||
### Observable Base Class → ObservableObject + [ObservableProperty]
|
||||
|
||||
**Before (custom Observable):**
|
||||
```csharp
|
||||
public class ResizeSize : Observable
|
||||
{
|
||||
private int _id;
|
||||
public int Id { get => _id; set => Set(ref _id, value); }
|
||||
|
||||
private ResizeFit _fit;
|
||||
public ResizeFit Fit
|
||||
{
|
||||
get => _fit;
|
||||
set
|
||||
{
|
||||
Set(ref _fit, value);
|
||||
UpdateShowHeight();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _showHeight = true;
|
||||
public bool ShowHeight { get => _showHeight; set => Set(ref _showHeight, value); }
|
||||
private void UpdateShowHeight() { ShowHeight = Fit == ResizeFit.Stretch || Unit != ResizeUnit.Percent; }
|
||||
}
|
||||
```
|
||||
|
||||
**After (CommunityToolkit.Mvvm source generators):**
|
||||
```csharp
|
||||
public partial class ResizeSize : ObservableObject // MUST be partial
|
||||
{
|
||||
[ObservableProperty]
|
||||
[JsonPropertyName("Id")]
|
||||
private int _id;
|
||||
|
||||
[ObservableProperty]
|
||||
[NotifyPropertyChangedFor(nameof(ShowHeight))] // Replaces manual UpdateShowHeight()
|
||||
private ResizeFit _fit;
|
||||
|
||||
// Computed property — no backing field, no manual update method
|
||||
public bool ShowHeight => Fit == ResizeFit.Stretch || Unit != ResizeUnit.Percent;
|
||||
}
|
||||
```
|
||||
|
||||
Key changes:
|
||||
- Class must be `partial` for source generators
|
||||
- `Observable` → `ObservableObject` (from CommunityToolkit.Mvvm)
|
||||
- Manual `Set(ref _field, value)` → `[ObservableProperty]` attribute
|
||||
- `PropertyChanged` dependencies → `[NotifyPropertyChangedFor(nameof(...))]`
|
||||
- Computed properties with manual `UpdateXxx()` → direct expression body
|
||||
|
||||
### Custom Name Setter with Transform
|
||||
|
||||
For properties that transform the value before storing:
|
||||
|
||||
```csharp
|
||||
// Cannot use [ObservableProperty] because of value transformation
|
||||
private string _name;
|
||||
public string Name
|
||||
{
|
||||
get => _name;
|
||||
set => SetProperty(ref _name, ReplaceTokens(value)); // SetProperty from ObservableObject
|
||||
}
|
||||
```
|
||||
|
||||
### RelayCommand → [RelayCommand] Source Generator
|
||||
|
||||
```csharp
|
||||
// DELETE: Helpers/RelayCommand.cs (custom ICommand)
|
||||
|
||||
// Before
|
||||
public ICommand ResizeCommand { get; } = new RelayCommand(Execute);
|
||||
|
||||
// After
|
||||
[RelayCommand]
|
||||
private void Resize() { /* ... */ }
|
||||
// Source generator creates ResizeCommand property automatically
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Resource String Migration (.resx → .resw)
|
||||
|
||||
### ResourceLoaderInstance Helper
|
||||
|
||||
```csharp
|
||||
internal static class ResourceLoaderInstance
|
||||
{
|
||||
internal static ResourceLoader ResourceLoader { get; private set; }
|
||||
|
||||
static ResourceLoaderInstance()
|
||||
{
|
||||
ResourceLoader = new ResourceLoader("PowerToys.ImageResizer.pri");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Note**: Use the single-argument `ResourceLoader` constructor. The two-argument version (`ResourceLoader("file.pri", "path/Resources")`) may fail if the resource map path doesn't match the actual PRI structure.
|
||||
|
||||
### Usage
|
||||
|
||||
```csharp
|
||||
// WPF
|
||||
using ImageResizer.Properties;
|
||||
string text = Resources.MyStringKey;
|
||||
|
||||
// WinUI 3
|
||||
string text = ResourceLoaderInstance.ResourceLoader.GetString("MyStringKey");
|
||||
```
|
||||
|
||||
### Lazy Initialization for Resource-Dependent Statics
|
||||
|
||||
`ResourceLoader` is not available at class-load time in all contexts (CLI mode, test harness). Use lazy initialization:
|
||||
|
||||
**Before (crashes at class load):**
|
||||
```csharp
|
||||
private static readonly CompositeFormat _format =
|
||||
CompositeFormat.Parse(Resources.Error_Format);
|
||||
|
||||
private static readonly Dictionary<string, string> _tokens = new()
|
||||
{
|
||||
["$small$"] = Resources.Small,
|
||||
["$medium$"] = Resources.Medium,
|
||||
};
|
||||
```
|
||||
|
||||
**After (lazy, safe):**
|
||||
```csharp
|
||||
private static CompositeFormat _format;
|
||||
private static CompositeFormat Format => _format ??=
|
||||
CompositeFormat.Parse(ResourceLoaderInstance.ResourceLoader.GetString("Error_Format"));
|
||||
|
||||
private static readonly Lazy<Dictionary<string, string>> _tokens = new(() =>
|
||||
new Dictionary<string, string>
|
||||
{
|
||||
["$small$"] = ResourceLoaderInstance.ResourceLoader.GetString("Small"),
|
||||
["$medium$"] = ResourceLoaderInstance.ResourceLoader.GetString("Medium"),
|
||||
});
|
||||
// Usage: _tokens.Value.TryGetValue(...)
|
||||
```
|
||||
|
||||
### XAML: x:Static → x:Uid
|
||||
|
||||
```xml
|
||||
<!-- WPF -->
|
||||
<Button Content="{x:Static p:Resources.Cancel}" />
|
||||
<!-- WinUI 3 -->
|
||||
<Button x:Uid="Cancel" />
|
||||
```
|
||||
|
||||
In `.resw`, use property-suffixed keys: `Cancel.Content`, `Header.Text`, etc.
|
||||
|
||||
---
|
||||
|
||||
## CLI Options Migration
|
||||
|
||||
`System.CommandLine.Option<T>` constructor signature changed:
|
||||
|
||||
```csharp
|
||||
// WPF era — string[] aliases
|
||||
public DestinationOption()
|
||||
: base(_aliases, Properties.Resources.CLI_Option_Destination)
|
||||
|
||||
// WinUI 3 — single string name
|
||||
public DestinationOption()
|
||||
: base(_aliases[0], ResourceLoaderInstance.ResourceLoader.GetString("CLI_Option_Destination"))
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Installer Updates
|
||||
|
||||
### WiX Changes
|
||||
|
||||
#### 1. Remove Satellite Assembly References
|
||||
|
||||
Remove from `installer/PowerToysSetupVNext/Resources.wxs`:
|
||||
- `<Component>` entries for `<Module>.resources.dll`
|
||||
- `<RemoveFolder>` entries for locale directories
|
||||
- Module from `WinUI3AppsInstallFolder` `ParentDirectory` loop
|
||||
|
||||
#### 2. Update File Component Generation
|
||||
|
||||
Run `generateAllFileComponents.ps1` after migration. For Exe→WinExe dependency issues, add cleanup logic:
|
||||
|
||||
```powershell
|
||||
# Strip phantom ImageResizer files from BaseApplications.wxs
|
||||
$content = $content -replace 'PowerToys\.ImageResizer\.exe', ''
|
||||
$content = $content -replace 'PowerToys\.ImageResizer\.deps\.json', ''
|
||||
$content = $content -replace 'PowerToys\.ImageResizer\.runtimeconfig\.json', ''
|
||||
```
|
||||
|
||||
#### 3. Output Directory
|
||||
|
||||
WinUI 3 modules output to `WinUI3Apps/`:
|
||||
```xml
|
||||
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\</OutputPath>
|
||||
```
|
||||
|
||||
### ESRP Signing
|
||||
|
||||
Update `.pipelines/ESRPSigning_core.json` — all module binaries must use `WinUI3Apps\\` paths:
|
||||
|
||||
```json
|
||||
{
|
||||
"FileList": [
|
||||
"WinUI3Apps\\PowerToys.ImageResizer.exe",
|
||||
"WinUI3Apps\\PowerToys.ImageResizerExt.dll",
|
||||
"WinUI3Apps\\PowerToys.ImageResizerContextMenu.dll"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Build Pipeline Fixes
|
||||
|
||||
### $(SolutionDir) → $(MSBuildThisFileDirectory)
|
||||
|
||||
`$(SolutionDir)` is empty when building individual projects outside the solution. Replace with relative paths from the project file:
|
||||
|
||||
```xml
|
||||
<!-- Before (breaks on standalone project build) -->
|
||||
<Exec Command="powershell $(SolutionDir)tools\build\convert-resx-to-rc.ps1" />
|
||||
|
||||
<!-- After (works always) -->
|
||||
<Exec Command="powershell $(MSBuildThisFileDirectory)..\..\..\..\tools\build\convert-resx-to-rc.ps1" />
|
||||
```
|
||||
|
||||
### MSIX Packaging: PreBuild → PostBuild
|
||||
|
||||
MSIX packaging must happen AFTER the build (artifacts not ready at PreBuild):
|
||||
|
||||
```xml
|
||||
<!-- Before -->
|
||||
<PreBuildEvent>MakeAppx.exe pack /d . /p "$(OutDir)Package.msix" /o</PreBuildEvent>
|
||||
|
||||
<!-- After -->
|
||||
<PostBuildEvent>
|
||||
if exist "$(OutDir)Package.msix" del "$(OutDir)Package.msix"
|
||||
MakeAppx.exe pack /d "$(MSBuildThisFileDirectory)." /p "$(OutDir)Package.msix" /o
|
||||
</PostBuildEvent>
|
||||
```
|
||||
|
||||
### RC File Icon Path Escaping
|
||||
|
||||
Windows Resource Compiler requires double-backslash paths:
|
||||
|
||||
```c
|
||||
// Before (breaks)
|
||||
IDI_ICON1 ICON "..\\ui\Assets\ImageResizer\ImageResizer.ico"
|
||||
// After
|
||||
IDI_ICON1 ICON "..\\ui\\Assets\\ImageResizer\\ImageResizer.ico"
|
||||
```
|
||||
|
||||
### BOM/Encoding Normalization
|
||||
|
||||
Migration may strip UTF-8 BOM from C# files (`// Copyright` → `// Copyright`). This is cosmetic and safe, but be aware it will show as changes in diff.
|
||||
|
||||
---
|
||||
|
||||
## Test Adaptation
|
||||
|
||||
### Tests Requiring WPF Runtime
|
||||
|
||||
If tests still need WPF types (e.g., comparing old vs new output), temporarily add:
|
||||
```xml
|
||||
<UseWPF>true</UseWPF>
|
||||
```
|
||||
Remove this after fully migrating all test code to WinRT APIs.
|
||||
|
||||
### Tests Using ResourceLoader
|
||||
|
||||
Unit tests cannot easily initialize WinUI 3 `ResourceLoader`. Options:
|
||||
- Hardcode expected strings in tests: `"Value must be between '{0}' and '{1}'."`
|
||||
- Delete tests that only verify resource string lookup
|
||||
- Avoid creating `App` instances in test harness (WinUI App cannot be instantiated in tests)
|
||||
|
||||
### Async Test Methods
|
||||
|
||||
All imaging tests become async:
|
||||
```csharp
|
||||
// Before
|
||||
[TestMethod]
|
||||
public void ResizesImage() { ... }
|
||||
|
||||
// After
|
||||
[TestMethod]
|
||||
public async Task ResizesImageAsync() { ... }
|
||||
```
|
||||
|
||||
### uint Assertions
|
||||
|
||||
```csharp
|
||||
// Before
|
||||
Assert.AreEqual(96, image.Frames[0].PixelWidth);
|
||||
// After
|
||||
Assert.AreEqual(96u, decoder.PixelWidth);
|
||||
```
|
||||
|
||||
### Pixel Data Access in Tests
|
||||
|
||||
```csharp
|
||||
// Before (WPF)
|
||||
public static Color GetFirstPixel(this BitmapSource source)
|
||||
{
|
||||
var pixel = new byte[4];
|
||||
new FormatConvertedBitmap(
|
||||
new CroppedBitmap(source, new Int32Rect(0, 0, 1, 1)),
|
||||
PixelFormats.Bgra32, null, 0).CopyPixels(pixel, 4, 0);
|
||||
return Color.FromArgb(pixel[3], pixel[2], pixel[1], pixel[0]);
|
||||
}
|
||||
|
||||
// After (WinRT)
|
||||
public static async Task<(byte R, byte G, byte B, byte A)> GetFirstPixelAsync(
|
||||
this BitmapDecoder decoder)
|
||||
{
|
||||
using var bitmap = await decoder.GetSoftwareBitmapAsync(
|
||||
BitmapPixelFormat.Bgra8, BitmapAlphaMode.Premultiplied);
|
||||
var buffer = new Windows.Storage.Streams.Buffer(
|
||||
(uint)(bitmap.PixelWidth * bitmap.PixelHeight * 4));
|
||||
bitmap.CopyToBuffer(buffer);
|
||||
using var reader = DataReader.FromBuffer(buffer);
|
||||
byte b = reader.ReadByte(), g = reader.ReadByte(),
|
||||
r = reader.ReadByte(), a = reader.ReadByte();
|
||||
return (r, g, b, a);
|
||||
}
|
||||
```
|
||||
|
||||
### Metadata Assertions
|
||||
|
||||
```csharp
|
||||
// Before
|
||||
Assert.AreEqual("Test", ((BitmapMetadata)image.Frames[0].Metadata).Comment);
|
||||
|
||||
// After
|
||||
var props = await decoder.BitmapProperties.GetPropertiesAsync(
|
||||
new[] { "System.Photo.DateTaken" });
|
||||
Assert.IsTrue(props.ContainsKey("System.Photo.DateTaken"),
|
||||
"Metadata should be preserved during transcode");
|
||||
```
|
||||
|
||||
### AllowUnsafeBlocks for SoftwareBitmap Tests
|
||||
|
||||
If tests access pixel data via `IMemoryBufferByteAccess`, add:
|
||||
```xml
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Settings JSON Backward Compatibility
|
||||
|
||||
- Settings are stored in `%LOCALAPPDATA%\Microsoft\PowerToys\<ModuleName>\`
|
||||
- Schema must remain backward-compatible across upgrades
|
||||
- Add new fields with defaults; never remove or rename existing fields
|
||||
- Create custom enums matching WPF enum integer values for deserialization (e.g., `ImagingEnums.cs`)
|
||||
- See: `src/settings-ui/Settings.UI.Library/`
|
||||
|
||||
## IPC Contract
|
||||
|
||||
If the module communicates with the runner or settings UI:
|
||||
1. Update BOTH sides of the IPC contract
|
||||
2. Test settings changes are received by the module
|
||||
3. Test module state changes are reflected in settings UI
|
||||
4. Reference: `doc/devdocs/core/settings/runner-ipc.md`
|
||||
|
||||
---
|
||||
|
||||
## Checklist for PowerToys Module Migration
|
||||
|
||||
### Project & Dependencies
|
||||
- [ ] Update `.csproj`: `UseWPF` → `UseWinUI`, TFM → `net8.0-windows10.0.19041.0`
|
||||
- [ ] Add `WindowsPackageType=None`, `SelfContained=true`, `WindowsAppSDKSelfContained=true`
|
||||
- [ ] Add `DISABLE_XAML_GENERATED_MAIN` if using custom `Program.cs`
|
||||
- [ ] Replace NuGet packages (WPF-UI → remove, add WindowsAppSDK, etc.)
|
||||
- [ ] Update project references (GPOWrapperProjection → GPOWrapper + CsWinRT)
|
||||
- [ ] Move `InternalsVisibleTo` from code to `.csproj`
|
||||
- [ ] Extract CLI shared logic to Library project (avoid Exe→WinExe dependency)
|
||||
|
||||
### MVVM & Resources
|
||||
- [ ] Replace custom `Observable`/`RelayCommand` with CommunityToolkit.Mvvm source generators
|
||||
- [ ] Migrate `.resx` → `.resw` (`Properties/Resources.resx` → `Strings/en-us/Resources.resw`)
|
||||
- [ ] Create `ResourceLoaderInstance` helper
|
||||
- [ ] Wrap resource-dependent statics in `Lazy<T>` or null-coalescing properties
|
||||
- [ ] Delete `Properties/Resources.Designer.cs`, `Observable.cs`, `RelayCommand.cs`
|
||||
|
||||
### XAML
|
||||
- [ ] Replace `clr-namespace:` → `using:` in all xmlns declarations
|
||||
- [ ] Remove WPF-UI (Lepo) xmlns and controls — use native WinUI 3
|
||||
- [ ] Replace `{x:Static p:Resources.Key}` → `x:Uid` with `.resw` keys
|
||||
- [ ] Replace `{DynamicResource}` → `{ThemeResource}`
|
||||
- [ ] Replace `DataType="{x:Type ...}"` → `x:DataType="..."`
|
||||
- [ ] Replace `<Style.Triggers>` → `VisualStateManager`
|
||||
- [ ] Add `<XamlControlsResources/>` to `App.xaml` merged dictionaries
|
||||
- [ ] Move `Window.Resources` to root container's `Resources`
|
||||
- [ ] Run XamlStyler: `.\.pipelines\applyXamlStyling.ps1 -Main`
|
||||
|
||||
### Code-Behind & APIs
|
||||
- [ ] Replace all `System.Windows.*` namespaces with `Microsoft.UI.Xaml.*`
|
||||
- [ ] Replace `Dispatcher` with `DispatcherQueue`
|
||||
- [ ] Store `DispatcherQueue` reference explicitly (no `Application.Current.Dispatcher`)
|
||||
- [ ] Implement `SizeToContent()` via AppWindow if needed
|
||||
- [ ] Update `ContentDialog` calls to set `XamlRoot`
|
||||
- [ ] Update `FilePicker` calls with HWND initialization
|
||||
- [ ] Migrate imaging code to `Windows.Graphics.Imaging` (async, `SoftwareBitmap`)
|
||||
- [ ] Create `CodecHelper` for legacy GUID → WinRT codec ID mapping (if imaging)
|
||||
- [ ] Create custom imaging enums for JSON backward compatibility (if imaging)
|
||||
- [ ] Update all `IValueConverter` signatures (`CultureInfo` → `string`)
|
||||
|
||||
### Build & Installer
|
||||
- [ ] Update WiX installer: remove satellite assembly refs from `Resources.wxs`
|
||||
- [ ] Run `generateAllFileComponents.ps1`; handle phantom artifacts
|
||||
- [ ] Update ESRP signing paths to `WinUI3Apps\\`
|
||||
- [ ] Fix `$(SolutionDir)` → `$(MSBuildThisFileDirectory)` in build events
|
||||
- [ ] Move MSIX packaging from PreBuild to PostBuild
|
||||
- [ ] Fix RC file path escaping (double-backslash)
|
||||
- [ ] Verify output dir is `WinUI3Apps/`
|
||||
|
||||
### Testing & Validation
|
||||
- [ ] Update test project: async methods, `uint` assertions
|
||||
- [ ] Handle ResourceLoader unavailability in tests (hardcode strings or skip)
|
||||
- [ ] Build clean: `cd` to project folder, `tools/build/build.cmd`, exit code 0
|
||||
- [ ] Run tests for affected module
|
||||
- [ ] Verify settings JSON backward compatibility
|
||||
- [ ] Test IPC contracts (runner ↔ settings UI)
|
||||
314
.github/skills/wpf-to-winui3-migration/references/threading-and-windowing.md
vendored
Normal file
314
.github/skills/wpf-to-winui3-migration/references/threading-and-windowing.md
vendored
Normal file
@@ -0,0 +1,314 @@
|
||||
# Threading and Window Management Migration
|
||||
|
||||
Based on patterns from the ImageResizer migration.
|
||||
|
||||
## Dispatcher → DispatcherQueue
|
||||
|
||||
### API Mapping
|
||||
|
||||
| WPF | WinUI 3 |
|
||||
|-----|---------|
|
||||
| `Dispatcher.Invoke(Action)` | `DispatcherQueue.TryEnqueue(Action)` |
|
||||
| `Dispatcher.BeginInvoke(Action)` | `DispatcherQueue.TryEnqueue(Action)` |
|
||||
| `Dispatcher.Invoke(DispatcherPriority, Action)` | `DispatcherQueue.TryEnqueue(DispatcherQueuePriority, Action)` |
|
||||
| `Dispatcher.CheckAccess()` | `DispatcherQueue.HasThreadAccess` |
|
||||
| `Dispatcher.VerifyAccess()` | Check `DispatcherQueue.HasThreadAccess` (no exception-throwing method) |
|
||||
|
||||
### Priority Mapping
|
||||
|
||||
WinUI 3 has only 3 levels: `High`, `Normal`, `Low`.
|
||||
|
||||
| WPF `DispatcherPriority` | WinUI 3 `DispatcherQueuePriority` |
|
||||
|-------------------------|----------------------------------|
|
||||
| `Send` | `High` |
|
||||
| `Normal` / `Input` / `Loaded` / `Render` / `DataBind` | `Normal` |
|
||||
| `Background` / `ContextIdle` / `ApplicationIdle` / `SystemIdle` | `Low` |
|
||||
|
||||
### Pattern: Global DispatcherQueue Access (from ImageResizer)
|
||||
|
||||
WPF provided `Application.Current.Dispatcher` globally. WinUI 3 requires explicit storage:
|
||||
|
||||
```csharp
|
||||
// Store DispatcherQueue at app startup
|
||||
private static DispatcherQueue _uiDispatcherQueue;
|
||||
|
||||
public static void InitializeDispatcher()
|
||||
{
|
||||
_uiDispatcherQueue = DispatcherQueue.GetForCurrentThread();
|
||||
}
|
||||
```
|
||||
|
||||
Usage with thread-check pattern (from `Settings.Reload()`):
|
||||
```csharp
|
||||
var currentDispatcher = DispatcherQueue.GetForCurrentThread();
|
||||
if (currentDispatcher != null)
|
||||
{
|
||||
// Already on UI thread
|
||||
ReloadCore(jsonSettings);
|
||||
}
|
||||
else if (_uiDispatcherQueue != null)
|
||||
{
|
||||
// Dispatch to UI thread
|
||||
_uiDispatcherQueue.TryEnqueue(() => ReloadCore(jsonSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fallback (e.g., CLI mode, no UI)
|
||||
ReloadCore(jsonSettings);
|
||||
}
|
||||
```
|
||||
|
||||
### Pattern: DispatcherQueue in ViewModels (from ProgressViewModel)
|
||||
|
||||
```csharp
|
||||
public class ProgressViewModel
|
||||
{
|
||||
private readonly DispatcherQueue _dispatcherQueue;
|
||||
|
||||
public ProgressViewModel()
|
||||
{
|
||||
_dispatcherQueue = DispatcherQueue.GetForCurrentThread();
|
||||
}
|
||||
|
||||
private void OnProgressChanged(double progress)
|
||||
{
|
||||
_dispatcherQueue.TryEnqueue(() =>
|
||||
{
|
||||
Progress = progress;
|
||||
// other UI updates...
|
||||
});
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Pattern: Async Dispatch (await)
|
||||
|
||||
```csharp
|
||||
// WPF
|
||||
await this.Dispatcher.InvokeAsync(() => { /* UI work */ });
|
||||
|
||||
// WinUI 3 (using TaskCompletionSource)
|
||||
var tcs = new TaskCompletionSource();
|
||||
this.DispatcherQueue.TryEnqueue(() =>
|
||||
{
|
||||
try { /* UI work */ tcs.SetResult(); }
|
||||
catch (Exception ex) { tcs.SetException(ex); }
|
||||
});
|
||||
await tcs.Task;
|
||||
```
|
||||
|
||||
### C++/WinRT Threading
|
||||
|
||||
| Old API | New API |
|
||||
|---------|---------|
|
||||
| `winrt::resume_foreground(CoreDispatcher)` | `wil::resume_foreground(DispatcherQueue)` |
|
||||
| `CoreDispatcher.RunAsync()` | `DispatcherQueue.TryEnqueue()` |
|
||||
|
||||
Add `Microsoft.Windows.ImplementationLibrary` NuGet for `wil::resume_foreground`.
|
||||
|
||||
---
|
||||
|
||||
## Window Management
|
||||
|
||||
### WPF Window vs WinUI 3 Window
|
||||
|
||||
| Feature | WPF `Window` | WinUI 3 `Window` |
|
||||
|---------|-------------|------------------|
|
||||
| Base class | `ContentControl` → `DependencyObject` | **NOT** a control, NOT a `DependencyObject` |
|
||||
| `Resources` property | Yes | No — use root container's `Resources` |
|
||||
| `DataContext` property | Yes | No — use root `Page`/`UserControl` |
|
||||
| `VisualStateManager` | Yes | No — use inside child controls |
|
||||
| `Load`/`Unload` events | Yes | No |
|
||||
| `SizeToContent` | Yes (`Height`/`Width`/`WidthAndHeight`) | No — must implement manually |
|
||||
| `WindowState` (min/max/normal) | Yes | No — use `AppWindow.Presenter` |
|
||||
| `WindowStyle` | Yes | No — use `AppWindow` title bar APIs |
|
||||
| `ResizeMode` | Yes | No — use `AppWindow.Presenter` |
|
||||
| `WindowStartupLocation` | Yes | No — calculate manually |
|
||||
| `Icon` | `Window.Icon` | `AppWindow.SetIcon()` |
|
||||
| `Title` | `Window.Title` | `AppWindow.Title` (or `Window.Title`) |
|
||||
| Size (Width/Height) | Yes | No — use `AppWindow.Resize()` |
|
||||
| Position (Left/Top) | Yes | No — use `AppWindow.Move()` |
|
||||
| `IsDefault`/`IsCancel` on buttons | Yes | No — handle Enter/Escape in code-behind |
|
||||
|
||||
### Getting AppWindow from Window
|
||||
|
||||
```csharp
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Windowing;
|
||||
using WinRT.Interop;
|
||||
|
||||
IntPtr hwnd = WindowNative.GetWindowHandle(window);
|
||||
WindowId windowId = Win32Interop.GetWindowIdFromWindow(hwnd);
|
||||
AppWindow appWindow = AppWindow.GetFromWindowId(windowId);
|
||||
```
|
||||
|
||||
### Pattern: SizeToContent Replacement (from ImageResizer)
|
||||
|
||||
WinUI 3 has no `SizeToContent`. ImageResizer implemented a manual equivalent:
|
||||
|
||||
```csharp
|
||||
private void SizeToContent()
|
||||
{
|
||||
if (Content is not FrameworkElement content)
|
||||
return;
|
||||
|
||||
// Measure desired content size
|
||||
content.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
||||
var desiredHeight = content.DesiredSize.Height + WindowChromeHeight + Padding;
|
||||
|
||||
// Account for DPI scaling
|
||||
var scaleFactor = Content.XamlRoot.RasterizationScale;
|
||||
var pixelHeight = (int)(desiredHeight * scaleFactor);
|
||||
var pixelWidth = (int)(WindowWidth * scaleFactor);
|
||||
|
||||
// Resize via AppWindow
|
||||
var hwnd = WindowNative.GetWindowHandle(this);
|
||||
var windowId = Win32Interop.GetWindowIdFromWindow(hwnd);
|
||||
var appWindow = AppWindow.GetFromWindowId(windowId);
|
||||
appWindow.Resize(new Windows.Graphics.SizeInt32(pixelWidth, pixelHeight));
|
||||
}
|
||||
```
|
||||
|
||||
**Key details:**
|
||||
- `WindowChromeHeight` ≈ 32px for the title bar
|
||||
- Must multiply by `RasterizationScale` for DPI-aware sizing
|
||||
- Call `SizeToContent()` after page navigation or content changes
|
||||
- Unsubscribe previous event handlers before subscribing new ones to avoid memory leaks
|
||||
|
||||
### Window Positioning (Center Screen)
|
||||
|
||||
```csharp
|
||||
var displayArea = DisplayArea.GetFromWindowId(windowId, DisplayAreaFallback.Nearest);
|
||||
var centerX = (displayArea.WorkArea.Width - appWindow.Size.Width) / 2;
|
||||
var centerY = (displayArea.WorkArea.Height - appWindow.Size.Height) / 2;
|
||||
appWindow.Move(new Windows.Graphics.PointInt32(centerX, centerY));
|
||||
```
|
||||
|
||||
### Window State (Minimize/Maximize)
|
||||
|
||||
```csharp
|
||||
(appWindow.Presenter as OverlappedPresenter)?.Maximize();
|
||||
(appWindow.Presenter as OverlappedPresenter)?.Minimize();
|
||||
(appWindow.Presenter as OverlappedPresenter)?.Restore();
|
||||
```
|
||||
|
||||
### Title Bar Customization
|
||||
|
||||
```csharp
|
||||
// Extend content into title bar
|
||||
this.ExtendsContentIntoTitleBar = true;
|
||||
this.SetTitleBar(AppTitleBar); // AppTitleBar is a XAML element
|
||||
|
||||
// Or via AppWindow API
|
||||
if (AppWindowTitleBar.IsCustomizationSupported())
|
||||
{
|
||||
var titleBar = appWindow.TitleBar;
|
||||
titleBar.ExtendsContentIntoTitleBar = true;
|
||||
titleBar.ButtonBackgroundColor = Colors.Transparent;
|
||||
}
|
||||
```
|
||||
|
||||
### Tracking the Main Window
|
||||
|
||||
```csharp
|
||||
public partial class App : Application
|
||||
{
|
||||
public static Window MainWindow { get; private set; }
|
||||
|
||||
protected override void OnLaunched(LaunchActivatedEventArgs args)
|
||||
{
|
||||
MainWindow = new MainWindow();
|
||||
MainWindow.Activate();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### ContentDialog Requires XamlRoot
|
||||
|
||||
```csharp
|
||||
var dialog = new ContentDialog
|
||||
{
|
||||
Title = "Confirm",
|
||||
Content = "Are you sure?",
|
||||
PrimaryButtonText = "Yes",
|
||||
CloseButtonText = "No",
|
||||
XamlRoot = this.Content.XamlRoot // REQUIRED
|
||||
};
|
||||
var result = await dialog.ShowAsync();
|
||||
```
|
||||
|
||||
### File Pickers Require HWND
|
||||
|
||||
```csharp
|
||||
var picker = new FileOpenPicker();
|
||||
picker.FileTypeFilter.Add(".jpg");
|
||||
|
||||
// REQUIRED for desktop apps
|
||||
var hwnd = WindowNative.GetWindowHandle(App.MainWindow);
|
||||
WinRT.Interop.InitializeWithWindow.Initialize(picker, hwnd);
|
||||
|
||||
var file = await picker.PickSingleFileAsync();
|
||||
```
|
||||
|
||||
### Window Close Handling
|
||||
|
||||
```csharp
|
||||
// WPF
|
||||
protected override void OnClosing(CancelEventArgs e) { e.Cancel = true; this.Hide(); }
|
||||
|
||||
// WinUI 3
|
||||
this.AppWindow.Closing += (s, e) => { e.Cancel = true; this.AppWindow.Hide(); };
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Custom Entry Point (DISABLE_XAML_GENERATED_MAIN)
|
||||
|
||||
ImageResizer uses a custom `Program.cs` entry point instead of the WinUI 3 auto-generated `Main`. This is needed for:
|
||||
- CLI mode (process files without showing UI)
|
||||
- Custom initialization before the WinUI 3 App starts
|
||||
- Single-instance enforcement
|
||||
|
||||
### Setup
|
||||
|
||||
In `.csproj`:
|
||||
```xml
|
||||
<DefineConstants>DISABLE_XAML_GENERATED_MAIN,TRACE</DefineConstants>
|
||||
```
|
||||
|
||||
Create `Program.cs`:
|
||||
```csharp
|
||||
public static class Program
|
||||
{
|
||||
[STAThread]
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
if (args.Length > 0)
|
||||
{
|
||||
// CLI mode — no UI
|
||||
return RunCli(args);
|
||||
}
|
||||
|
||||
// GUI mode
|
||||
WinRT.ComWrappersSupport.InitializeComWrappers();
|
||||
Application.Start((p) =>
|
||||
{
|
||||
var context = new DispatcherQueueSynchronizationContext(
|
||||
DispatcherQueue.GetForCurrentThread());
|
||||
SynchronizationContext.SetSynchronizationContext(context);
|
||||
_ = new App();
|
||||
});
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### WPF App Constructor Removal
|
||||
|
||||
WPF modules often created `new App()` to initialize the WPF `Application` and get `Application.Current.Dispatcher`. This is no longer needed — the WinUI 3 `Application.Start()` handles this.
|
||||
|
||||
```csharp
|
||||
// DELETE (WPF pattern):
|
||||
_imageResizerApp = new App();
|
||||
// REPLACE with: Store DispatcherQueue explicitly (see Global DispatcherQueue Access above)
|
||||
```
|
||||
365
.github/skills/wpf-to-winui3-migration/references/xaml-migration.md
vendored
Normal file
365
.github/skills/wpf-to-winui3-migration/references/xaml-migration.md
vendored
Normal file
@@ -0,0 +1,365 @@
|
||||
# XAML Migration Guide
|
||||
|
||||
Detailed reference for migrating XAML from WPF to WinUI 3, based on the ImageResizer migration.
|
||||
|
||||
## XML Namespace Declaration Changes
|
||||
|
||||
### Before (WPF)
|
||||
|
||||
```xml
|
||||
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:MyApp"
|
||||
xmlns:m="clr-namespace:ImageResizer.Models"
|
||||
xmlns:p="clr-namespace:ImageResizer.Properties"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
|
||||
x:Class="MyApp.MainWindow">
|
||||
```
|
||||
|
||||
### After (WinUI 3)
|
||||
|
||||
```xml
|
||||
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:MyApp"
|
||||
xmlns:m="using:ImageResizer.Models"
|
||||
xmlns:converters="using:ImageResizer.Converters"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Class="MyApp.MainWindow">
|
||||
```
|
||||
|
||||
### Key Changes
|
||||
|
||||
| WPF Syntax | WinUI 3 Syntax | Notes |
|
||||
|------------|---------------|-------|
|
||||
| `clr-namespace:Foo` | `using:Foo` | CLR namespace mapping |
|
||||
| `clr-namespace:Foo;assembly=Bar` | `using:Foo` | Assembly qualification not needed |
|
||||
| `xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"` | **Remove entirely** | WPF-UI namespace no longer needed |
|
||||
| `xmlns:p="clr-namespace:...Properties"` | **Remove** | No more `.resx` string bindings |
|
||||
| `sys:String` (from mscorlib) | `x:String` | XAML intrinsic types |
|
||||
| `sys:Int32` | `x:Int32` | XAML intrinsic types |
|
||||
| `sys:Boolean` | `x:Boolean` | XAML intrinsic types |
|
||||
| `sys:Double` | `x:Double` | XAML intrinsic types |
|
||||
|
||||
## Unsupported Markup Extensions
|
||||
|
||||
| WPF Markup Extension | WinUI 3 Alternative |
|
||||
|----------------------|---------------------|
|
||||
| `{DynamicResource Key}` | `{ThemeResource Key}` (theme-reactive) or `{StaticResource Key}` |
|
||||
| `{x:Static Type.Member}` | `{x:Bind}` to a static property, or code-behind |
|
||||
| `{x:Type local:MyType}` | Not supported; use code-behind |
|
||||
| `{x:Array}` | Not supported; create collections in code-behind |
|
||||
| `{x:Code}` | Not supported |
|
||||
|
||||
### DynamicResource → ThemeResource
|
||||
|
||||
```xml
|
||||
<!-- WPF -->
|
||||
<TextBlock Foreground="{DynamicResource MyBrush}" />
|
||||
|
||||
<!-- WinUI 3 -->
|
||||
<TextBlock Foreground="{ThemeResource MyBrush}" />
|
||||
```
|
||||
|
||||
`ThemeResource` automatically updates when the app theme changes (Light/Dark/HighContrast). For truly dynamic non-theme resources, set values in code-behind or use data binding.
|
||||
|
||||
### x:Static Resource Strings → x:Uid
|
||||
|
||||
This is the most pervasive XAML change. WPF used `{x:Static}` to bind to strongly-typed `.resx` resource strings. WinUI 3 uses `x:Uid` with `.resw` files.
|
||||
|
||||
**WPF:**
|
||||
```xml
|
||||
<Button Content="{x:Static p:Resources.Cancel}" />
|
||||
<TextBlock Text="{x:Static p:Resources.Input_Header}" />
|
||||
```
|
||||
|
||||
**WinUI 3:**
|
||||
```xml
|
||||
<Button x:Uid="Cancel" />
|
||||
<TextBlock x:Uid="Input_Header" />
|
||||
```
|
||||
|
||||
In `Strings/en-us/Resources.resw`:
|
||||
```xml
|
||||
<data name="Cancel.Content" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="Input_Header.Text" xml:space="preserve">
|
||||
<value>Select a size</value>
|
||||
</data>
|
||||
```
|
||||
|
||||
The `x:Uid` suffix (`.Content`, `.Text`, `.Header`, `.PlaceholderText`, etc.) matches the target property name.
|
||||
|
||||
### DataType with x:Type → Remove
|
||||
|
||||
**WPF:**
|
||||
```xml
|
||||
<DataTemplate DataType="{x:Type m:ResizeSize}">
|
||||
```
|
||||
|
||||
**WinUI 3:**
|
||||
```xml
|
||||
<DataTemplate x:DataType="m:ResizeSize">
|
||||
```
|
||||
|
||||
## WPF-UI (Lepo) Controls Removal
|
||||
|
||||
If the module uses the `WPF-UI` library, replace all Lepo controls with native WinUI 3 equivalents.
|
||||
|
||||
### Window
|
||||
|
||||
```xml
|
||||
<!-- WPF (WPF-UI) -->
|
||||
<ui:FluentWindow
|
||||
ExtendsContentIntoTitleBar="True"
|
||||
WindowStartupLocation="CenterScreen">
|
||||
<ui:TitleBar Title="Image Resizer" />
|
||||
...
|
||||
</ui:FluentWindow>
|
||||
|
||||
<!-- WinUI 3 (native) -->
|
||||
<Window>
|
||||
<!-- Title bar managed via code-behind: this.ExtendsContentIntoTitleBar = true; -->
|
||||
...
|
||||
</Window>
|
||||
```
|
||||
|
||||
### App.xaml Resources
|
||||
|
||||
```xml
|
||||
<!-- WPF (WPF-UI) -->
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ui:ThemesDictionary Theme="Dark" />
|
||||
<ui:ControlsDictionary />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
|
||||
<!-- WinUI 3 (native) -->
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
```
|
||||
|
||||
### Common Control Replacements
|
||||
|
||||
```xml
|
||||
<!-- WPF-UI NumberBox -->
|
||||
<ui:NumberBox Value="{Binding Width}" />
|
||||
<!-- WinUI 3 -->
|
||||
<NumberBox Value="{x:Bind ViewModel.Width, Mode=TwoWay}" />
|
||||
|
||||
<!-- WPF-UI InfoBar -->
|
||||
<ui:InfoBar Title="Warning" Message="..." IsOpen="True" Severity="Warning" />
|
||||
<!-- WinUI 3 -->
|
||||
<InfoBar Title="Warning" Message="..." IsOpen="True" Severity="Warning" />
|
||||
|
||||
<!-- WPF-UI ProgressRing -->
|
||||
<ui:ProgressRing IsIndeterminate="True" />
|
||||
<!-- WinUI 3 -->
|
||||
<ProgressRing IsActive="True" />
|
||||
|
||||
<!-- WPF-UI SymbolIcon -->
|
||||
<ui:SymbolIcon Symbol="Add" />
|
||||
<!-- WinUI 3 -->
|
||||
<SymbolIcon Symbol="Add" />
|
||||
```
|
||||
|
||||
### Button Patterns
|
||||
|
||||
```xml
|
||||
<!-- WPF -->
|
||||
<Button IsDefault="True" Content="OK" />
|
||||
<Button IsCancel="True" Content="Cancel" />
|
||||
|
||||
<!-- WinUI 3 (no IsDefault/IsCancel) -->
|
||||
<Button Style="{StaticResource AccentButtonStyle}" Content="OK" />
|
||||
<Button Content="Cancel" />
|
||||
<!-- Handle Enter/Escape keys in code-behind if needed -->
|
||||
```
|
||||
|
||||
## Style and Template Changes
|
||||
|
||||
### Triggers → VisualStateManager
|
||||
|
||||
WPF `Triggers`, `DataTriggers`, and `EventTriggers` are not supported.
|
||||
|
||||
**WPF:**
|
||||
```xml
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="LightBlue"/>
|
||||
</Trigger>
|
||||
<DataTrigger Binding="{Binding IsEnabled}" Value="False">
|
||||
<Setter Property="Opacity" Value="0.5"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
```
|
||||
|
||||
**WinUI 3:**
|
||||
```xml
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid x:Name="RootGrid" Background="{TemplateBinding Background}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="RootGrid.Background" Value="LightBlue"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ContentPresenter />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
```
|
||||
|
||||
### No Binding in Setter.Value
|
||||
|
||||
```xml
|
||||
<!-- WPF (works) -->
|
||||
<Setter Property="Foreground" Value="{Binding TextColor}"/>
|
||||
|
||||
<!-- WinUI 3 (does NOT work — use StaticResource) -->
|
||||
<Setter Property="Foreground" Value="{StaticResource TextColorBrush}"/>
|
||||
```
|
||||
|
||||
### Visual State Name Changes
|
||||
|
||||
| WPF | WinUI 3 |
|
||||
|-----|---------|
|
||||
| `MouseOver` | `PointerOver` |
|
||||
| `Disabled` | `Disabled` |
|
||||
| `Pressed` | `Pressed` |
|
||||
|
||||
## Resource Dictionary Changes
|
||||
|
||||
### Window.Resources → Grid.Resources
|
||||
|
||||
WinUI 3 `Window` is NOT a `DependencyObject` — no `Window.Resources`, `DataContext`, or `VisualStateManager`.
|
||||
|
||||
```xml
|
||||
<!-- WPF -->
|
||||
<Window>
|
||||
<Window.Resources>
|
||||
<SolidColorBrush x:Key="MyBrush" Color="Red"/>
|
||||
</Window.Resources>
|
||||
<Grid>...</Grid>
|
||||
</Window>
|
||||
|
||||
<!-- WinUI 3 -->
|
||||
<Window>
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<SolidColorBrush x:Key="MyBrush" Color="Red"/>
|
||||
</Grid.Resources>
|
||||
...
|
||||
</Grid>
|
||||
</Window>
|
||||
```
|
||||
|
||||
### Theme Dictionaries
|
||||
|
||||
```xml
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SolidColorBrush x:Key="MyBrush" Color="#FF000000"/>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SolidColorBrush x:Key="MyBrush" Color="#FFFFFFFF"/>
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="HighContrast">
|
||||
<SolidColorBrush x:Key="MyBrush" Color="{ThemeResource SystemColorWindowTextColor}"/>
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
```
|
||||
|
||||
## URI Scheme Changes
|
||||
|
||||
| WPF | WinUI 3 |
|
||||
|-----|---------|
|
||||
| `pack://application:,,,/MyAssembly;component/image.png` | `ms-appx:///Assets/image.png` |
|
||||
| `pack://application:,,,/image.png` | `ms-appx:///image.png` |
|
||||
| Relative path `../image.png` | `ms-appx:///image.png` |
|
||||
|
||||
Assets directory convention: `Resources/` → `Assets/<Module>/`
|
||||
|
||||
## Data Binding Changes
|
||||
|
||||
### {Binding} vs {x:Bind}
|
||||
|
||||
Both are available. Prefer `{x:Bind}` for compile-time safety and performance.
|
||||
|
||||
| Feature | `{Binding}` | `{x:Bind}` |
|
||||
|---------|------------|------------|
|
||||
| Default mode | `OneWay` | **`OneTime`** (explicit `Mode=OneWay` required!) |
|
||||
| Context | `DataContext` | Code-behind class |
|
||||
| Resolution | Runtime | Compile-time |
|
||||
| Performance | Reflection-based | Compiled |
|
||||
| Function binding | No | Yes |
|
||||
|
||||
### WPF-Specific Binding Features to Remove
|
||||
|
||||
```xml
|
||||
<!-- These WPF-only features must be removed or rewritten -->
|
||||
<TextBox Text="{Binding Value, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<!-- WinUI 3: UpdateSourceTrigger not needed; TextBox uses PropertyChanged by default -->
|
||||
<TextBox Text="{x:Bind ViewModel.Value, Mode=TwoWay}" />
|
||||
|
||||
{Binding RelativeSource={RelativeSource Self}, ...}
|
||||
<!-- WinUI 3: Use x:Bind which binds to the page itself, or use ElementName -->
|
||||
|
||||
<ItemsControl ItemsSource="{Binding}" />
|
||||
<!-- WinUI 3: Must specify explicit path -->
|
||||
<ItemsControl ItemsSource="{x:Bind ViewModel.Items}" />
|
||||
```
|
||||
|
||||
## WPF-Only Window Properties to Remove
|
||||
|
||||
These properties exist on WPF `Window` but not WinUI 3:
|
||||
|
||||
```xml
|
||||
<!-- Remove from XAML — handle in code-behind via AppWindow API -->
|
||||
SizeToContent="Height"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ResizeMode="NoResize"
|
||||
ExtendsContentIntoTitleBar="True" <!-- Set in code-behind -->
|
||||
```
|
||||
|
||||
## XAML Control Property Changes
|
||||
|
||||
| WPF Property | WinUI 3 Property | Notes |
|
||||
|-------------|-----------------|-------|
|
||||
| `Focusable` | `IsTabStop` | Different name |
|
||||
| `SnapsToDevicePixels` | Not available | WinUI handles pixel snapping internally |
|
||||
| `UseLayoutRounding` | `UseLayoutRounding` | Same |
|
||||
| `IsHitTestVisible` | `IsHitTestVisible` | Same |
|
||||
| `TextBox.VerticalScrollBarVisibility` | `ScrollViewer.VerticalScrollBarVisibility` (attached) | Attached property |
|
||||
|
||||
## XAML Formatting (XamlStyler)
|
||||
|
||||
After migration, run XamlStyler to normalize formatting:
|
||||
- Alphabetize xmlns declarations and element attributes
|
||||
- Add UTF-8 BOM to all XAML files
|
||||
- Normalize comment spacing: `<!-- text -->` → `<!-- text -->`
|
||||
|
||||
PowerToys command: `.\.pipelines\applyXamlStyling.ps1 -Main`
|
||||
4
.github/workflows/msstore-submissions.yml
vendored
4
.github/workflows/msstore-submissions.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
export $(echo 'anypass_just_to_unlock' | gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh)
|
||||
|
||||
- name: Log in to Azure
|
||||
uses: azure/login@v2
|
||||
uses: azure/login@v3
|
||||
with:
|
||||
client-id: ${{ secrets.AZURE_CLIENT_ID }}
|
||||
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
- uses: microsoft/setup-msstore-cli@v1
|
||||
|
||||
- name: Fetch Store Credential
|
||||
uses: azure/cli@v2
|
||||
uses: azure/cli@v3
|
||||
with:
|
||||
azcliversion: latest
|
||||
inlineScript: |-
|
||||
|
||||
13
.github/workflows/spelling2.yml
vendored
13
.github/workflows/spelling2.yml
vendored
@@ -93,7 +93,7 @@ jobs:
|
||||
steps:
|
||||
- name: check-spelling
|
||||
id: spelling
|
||||
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
|
||||
uses: check-spelling/check-spelling@cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c # v0.0.26
|
||||
with:
|
||||
config: .github/actions/spell-check
|
||||
suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }}
|
||||
@@ -135,6 +135,7 @@ jobs:
|
||||
cspell:cpp/compiler-msvc.txt
|
||||
cspell:python/common/extra.txt
|
||||
cspell:scala/scala.txt
|
||||
ignored: ignored-expect-variant
|
||||
|
||||
comment-push:
|
||||
name: Report (Push)
|
||||
@@ -147,10 +148,8 @@ jobs:
|
||||
if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push'
|
||||
steps:
|
||||
- name: comment
|
||||
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
|
||||
uses: check-spelling/check-spelling@cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c # v0.0.26
|
||||
with:
|
||||
config: .github/actions/spell-check
|
||||
checkout: true
|
||||
spell_check_this: microsoft/PowerToys@main
|
||||
task: ${{ needs.spelling.outputs.followup }}
|
||||
|
||||
@@ -166,10 +165,8 @@ jobs:
|
||||
if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request')
|
||||
steps:
|
||||
- name: comment
|
||||
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
|
||||
uses: check-spelling/check-spelling@cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c # v0.0.26
|
||||
with:
|
||||
config: .github/actions/spell-check
|
||||
checkout: true
|
||||
spell_check_this: check-spelling/spell-check-this@prerelease
|
||||
task: ${{ needs.spelling.outputs.followup }}
|
||||
experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }}
|
||||
@@ -193,7 +190,7 @@ jobs:
|
||||
cancel-in-progress: false
|
||||
steps:
|
||||
- name: apply spelling updates
|
||||
uses: check-spelling/check-spelling@c635c2f3f714eec2fcf27b643a1919b9a811ef2e # v0.0.25
|
||||
uses: check-spelling/check-spelling@cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c # v0.0.26
|
||||
with:
|
||||
experimental_apply_changes_via_bot: ${{ github.repository_owner != 'microsoft' && 1 }}
|
||||
checkout: true
|
||||
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -360,3 +360,11 @@ src/common/Telemetry/*.etl
|
||||
# PowerToysInstaller Build Temp Files
|
||||
installer/*/*.wxs.bk
|
||||
/src/modules/awake/.claude
|
||||
|
||||
# Claude AI local settings - local-only, not committed
|
||||
**/.claude/settings.local.json
|
||||
|
||||
# Squad / Copilot agents — local-only, not committed
|
||||
.squad/
|
||||
.squad-workstream
|
||||
.github/agents/
|
||||
|
||||
@@ -109,7 +109,8 @@
|
||||
"PowerToys.KeyboardManager.dll",
|
||||
|
||||
"KeyboardManagerEditor\\PowerToys.KeyboardManagerEditor.exe",
|
||||
"KeyboardManagerEditorUI\\PowerToys.KeyboardManagerEditorUI.exe",
|
||||
"WinUI3Apps\\PowerToys.KeyboardManagerEditorUI.exe",
|
||||
"WinUI3Apps\\PowerToys.KeyboardManagerEditorUI.dll",
|
||||
"KeyboardManagerEngine\\PowerToys.KeyboardManagerEngine.exe",
|
||||
"PowerToys.KeyboardManagerEditorLibraryWrapper.dll",
|
||||
"WinUI3Apps\\PowerToys.HostsModuleInterface.dll",
|
||||
@@ -140,13 +141,13 @@
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariables.dll",
|
||||
"WinUI3Apps\\PowerToys.EnvironmentVariables.exe",
|
||||
|
||||
"PowerToys.ImageResizer.exe",
|
||||
"PowerToys.ImageResizer.dll",
|
||||
"WinUI3Apps\\PowerToys.ImageResizer.exe",
|
||||
"WinUI3Apps\\PowerToys.ImageResizer.dll",
|
||||
"WinUI3Apps\\PowerToys.ImageResizerCLI.exe",
|
||||
"WinUI3Apps\\PowerToys.ImageResizerCLI.dll",
|
||||
"PowerToys.ImageResizerExt.dll",
|
||||
"PowerToys.ImageResizerContextMenu.dll",
|
||||
"ImageResizerContextMenuPackage.msix",
|
||||
"WinUI3Apps\\PowerToys.ImageResizerExt.dll",
|
||||
"WinUI3Apps\\PowerToys.ImageResizerContextMenu.dll",
|
||||
"WinUI3Apps\\ImageResizerContextMenuPackage.msix",
|
||||
|
||||
"PowerToys.LightSwitchModuleInterface.dll",
|
||||
"LightSwitchService\\PowerToys.LightSwitchService.exe",
|
||||
@@ -216,7 +217,11 @@
|
||||
"PowerToys.PowerAccentModuleInterface.dll",
|
||||
"PowerToys.PowerAccentKeyboardService.dll",
|
||||
|
||||
"PowerToys.PowerDisplayModuleInterface.dll",
|
||||
"WinUI3Apps\\PowerToys.PowerDisplay.dll",
|
||||
"WinUI3Apps\\PowerToys.PowerDisplay.exe",
|
||||
"PowerDisplay.Lib.dll",
|
||||
"PowerDisplay.Models.dll",
|
||||
|
||||
"WinUI3Apps\\PowerToys.PowerRenameExt.dll",
|
||||
"WinUI3Apps\\PowerToys.PowerRename.exe",
|
||||
|
||||
@@ -210,6 +210,9 @@ jobs:
|
||||
& '.pipelines/applyXamlStyling.ps1' -Passive
|
||||
displayName: Verify XAML formatting
|
||||
|
||||
- task: NuGetAuthenticate@1
|
||||
displayName: Authenticate NuGet feeds for verification
|
||||
|
||||
- pwsh: |-
|
||||
& '.pipelines/verifyNugetPackages.ps1' -solution '$(build.sourcesdirectory)\PowerToys.slnx'
|
||||
displayName: Verify Nuget package versions for PowerToys.slnx
|
||||
|
||||
39
AGENTS.md
39
AGENTS.md
@@ -3,7 +3,7 @@ description: 'Top-level AI contributor guidance for developing PowerToys - a col
|
||||
applyTo: '**'
|
||||
---
|
||||
|
||||
# PowerToys – AI Contributor Guide
|
||||
# PowerToys – AI contributor guide
|
||||
|
||||
This is the top-level guidance for AI contributions to PowerToys. Keep changes atomic, follow existing patterns, and cite exact paths in PRs.
|
||||
|
||||
@@ -26,13 +26,15 @@ For architecture details and module types, see [Architecture Overview](doc/devdo
|
||||
## Conventions
|
||||
|
||||
For detailed coding conventions, see:
|
||||
|
||||
- [Coding Guidelines](doc/devdocs/development/guidelines.md) – Dependencies, testing, PR management
|
||||
- [Coding Style](doc/devdocs/development/style.md) – Formatting, C++/C#/XAML style rules
|
||||
- [Logging](doc/devdocs/development/logging.md) – C++ spdlog and C# Logger usage
|
||||
|
||||
### Component-Specific Instructions
|
||||
### Component-specific instructions
|
||||
|
||||
These instruction files are automatically applied when working in their respective areas:
|
||||
|
||||
- [Runner & Settings UI](.github/instructions/runner-settings-ui.instructions.md) – IPC contracts, schema migrations
|
||||
- [Common Libraries](.github/instructions/common-libraries.instructions.md) – ABI stability, shared code guidelines
|
||||
|
||||
@@ -44,7 +46,7 @@ These instruction files are automatically applied when working in their respecti
|
||||
- Windows 10 1803+ (April 2018 Update or newer)
|
||||
- Initialize submodules once: `git submodule update --init --recursive`
|
||||
|
||||
### Build Commands
|
||||
### Build commands
|
||||
|
||||
| Task | Command |
|
||||
|------|---------|
|
||||
@@ -52,7 +54,7 @@ These instruction files are automatically applied when working in their respecti
|
||||
| Build current folder | `tools\build\build.cmd` |
|
||||
| Build with options | `build.ps1 -Platform x64 -Configuration Release` |
|
||||
|
||||
### Build Discipline
|
||||
### Build discipline
|
||||
|
||||
1. One terminal per operation (build → test). Do not switch or open new ones mid-flow
|
||||
2. After making changes, `cd` to the project folder that changed (`.csproj`/`.vcxproj`)
|
||||
@@ -62,9 +64,10 @@ These instruction files are automatically applied when working in their respecti
|
||||
6. On failure, read the errors log: `build.<config>.<platform>.errors.log`
|
||||
7. Do not start tests or launch Runner until the build succeeds
|
||||
|
||||
### Build Logs
|
||||
### Build logs
|
||||
|
||||
Located next to the solution/project being built:
|
||||
|
||||
- `build.<configuration>.<platform>.errors.log` – errors only (check this first)
|
||||
- `build.<configuration>.<platform>.all.log` – full log
|
||||
- `build.<configuration>.<platform>.trace.binlog` – for MSBuild Structured Log Viewer
|
||||
@@ -73,18 +76,18 @@ For complete details, see [Build Guidelines](tools/build/BUILD-GUIDELINES.md).
|
||||
|
||||
## Tests
|
||||
|
||||
### Test Discovery
|
||||
### Test discovery
|
||||
|
||||
- Find test projects by product code prefix (e.g., `FancyZones`, `AdvancedPaste`)
|
||||
- Look for sibling folders or 1-2 levels up named `<Product>*UnitTests` or `<Product>*UITests`
|
||||
|
||||
### Running Tests
|
||||
### Running tests
|
||||
|
||||
1. **Build the test project first**, wait for exit code 0
|
||||
2. Run via VS Test Explorer (`Ctrl+E, T`) or `vstest.console.exe` with filters
|
||||
3. **Avoid `dotnet test`** in this repo – use VS Test Explorer or vstest.console.exe
|
||||
|
||||
### Test Types
|
||||
### Test types
|
||||
|
||||
| Type | Requirements | Setup |
|
||||
|------|--------------|-------|
|
||||
@@ -92,13 +95,13 @@ For complete details, see [Build Guidelines](tools/build/BUILD-GUIDELINES.md).
|
||||
| UI Tests | WinAppDriver v1.2.1, Developer Mode | Install from [WinAppDriver releases](https://github.com/microsoft/WinAppDriver/releases/tag/v1.2.1) |
|
||||
| Fuzz Tests | OneFuzz, .NET 8 | See [Fuzzing Tests](doc/devdocs/tools/fuzzingtesting.md) |
|
||||
|
||||
### Test Discipline
|
||||
### Test discipline
|
||||
|
||||
1. Add or adjust tests when changing behavior
|
||||
2. If tests skipped, state why (e.g., comment-only change, string rename)
|
||||
3. New modules handling file I/O or user input **must** implement fuzzing tests
|
||||
|
||||
### Special Requirements
|
||||
### Special requirements
|
||||
|
||||
- **Mouse Without Borders**: Requires 2+ physical computers (not VMs)
|
||||
- **Multi-monitor utilities**: Test with 2+ monitors, different DPI settings
|
||||
@@ -107,14 +110,14 @@ For UI test setup details, see [UI Tests](doc/devdocs/development/ui-tests.md).
|
||||
|
||||
## Boundaries
|
||||
|
||||
### Ask for Clarification When
|
||||
### Ask for clarification when
|
||||
|
||||
- Ambiguous spec after scanning relevant docs
|
||||
- Cross-module impact (shared enum/struct) is unclear
|
||||
- Security, elevation, or installer changes involved
|
||||
- GPO or policy handling modifications needed
|
||||
|
||||
### Areas Requiring Extra Care
|
||||
### Areas requiring extra care
|
||||
|
||||
| Area | Concern | Reference |
|
||||
|------|---------|-----------|
|
||||
@@ -123,7 +126,7 @@ For UI test setup details, see [UI Tests](doc/devdocs/development/ui-tests.md).
|
||||
| Installer files | Release impact | Careful review required |
|
||||
| Elevation/GPO logic | Security | Confirm no regression in policy handling |
|
||||
|
||||
### What NOT to Do
|
||||
### What not to do
|
||||
|
||||
- Don't merge incomplete features into main (use feature branches)
|
||||
- Don't break IPC/JSON contracts without updating both runner and settings-ui
|
||||
@@ -143,23 +146,27 @@ Before finishing, verify:
|
||||
|
||||
## Documentation Index
|
||||
|
||||
### Core Architecture
|
||||
### Core architecture
|
||||
|
||||
- [Architecture Overview](doc/devdocs/core/architecture.md)
|
||||
- [Runner](doc/devdocs/core/runner.md)
|
||||
- [Settings System](doc/devdocs/core/settings/readme.md)
|
||||
- [Module Interface](doc/devdocs/modules/interface.md)
|
||||
|
||||
### Development
|
||||
|
||||
- [Coding Guidelines](doc/devdocs/development/guidelines.md)
|
||||
- [Coding Style](doc/devdocs/development/style.md)
|
||||
- [Logging](doc/devdocs/development/logging.md)
|
||||
- [UI Tests](doc/devdocs/development/ui-tests.md)
|
||||
- [Fuzzing Tests](doc/devdocs/tools/fuzzingtesting.md)
|
||||
|
||||
### Build & Tools
|
||||
### Build & tools
|
||||
|
||||
- [Build Guidelines](tools/build/BUILD-GUIDELINES.md)
|
||||
- [Tools Overview](doc/devdocs/tools/readme.md)
|
||||
|
||||
### Instructions (Auto-Applied)
|
||||
### Instructions (auto-applied)
|
||||
|
||||
- [Runner & Settings UI](.github/instructions/runner-settings-ui.instructions.md)
|
||||
- [Common Libraries](.github/instructions/common-libraries.instructions.md)
|
||||
|
||||
121
COMMUNITY.md
121
COMMUNITY.md
@@ -1,84 +1,109 @@
|
||||
# Community
|
||||
|
||||
The PowerToys team is extremely grateful to have the support of an amazing active community. The work you do is incredibly important. PowerToys wouldn’t be near what it is without your help filing bugs, updating documentation, guiding the design, or writing features. We want to say thanks and to recognize your work. This is a living document dedicated to highlighting the high impact community members and their contributions.
|
||||
The PowerToys team is extremely grateful to have the support of an amazing active community. The work you do is incredibly important. PowerToys wouldn't be near what it is without your help filing bugs, updating documentation, guiding the design, or writing features. We want to say thanks and to recognize your work. This is a living document dedicated to highlighting the high impact community members and their contributions.
|
||||
|
||||
Names are in alphabetical order based on first name.
|
||||
Names are in alphabetical order, based on first name.
|
||||
|
||||
## High impact community members
|
||||
|
||||
### [@cgaarden](https://github.com/cgaarden) - [Christian Gaarden Gaardmark](https://www.onegreatworld.com)
|
||||
Christian contributed New+ utility
|
||||
### [@cgaarden](https://github.com/cgaarden) - [Christian Gaarden Gaardmark](https://www.onegreatworld.com)
|
||||
|
||||
Christian contributed the New+ utility
|
||||
|
||||
### [@CleanCodeDeveloper](https://github.com/CleanCodeDeveloper)
|
||||
|
||||
CleanCodeDeveloper helped do massive amounts of code stability and image resizer work.
|
||||
|
||||
### [@plante-msft](https://github.com/plante-msft) - Connor Plante
|
||||
|
||||
Connor was the creator of Workspaces and helped create Command Palette (PowerToys Run v2)
|
||||
|
||||
### [@damienleroy](https://github.com/damienleroy) - [Damien Leroy](https://www.linkedin.com/in/Damien-Leroy-b2734416a/)
|
||||
|
||||
Damien has helped out by developing and contributing the Quick Accent utility.
|
||||
|
||||
### [@daverayment](https://github.com/daverayment) - [David Rayment](https://www.linkedin.com/in/david-rayment-168b5251/)
|
||||
|
||||
Dave has helped improve the experience inside of Peek by adding in new features and fixing bugs.
|
||||
|
||||
### [@davidegiacometti](https://github.com/davidegiacometti) - [Davide Giacometti](https://www.linkedin.com/in/davidegiacometti/)
|
||||
|
||||
Davide has helped fix multiple bugs, added new utilities, features, as well as help us with the ARM64 effort by porting applications to .NET Core.
|
||||
|
||||
### [@ethanfangg](https://github.com/ethanfangg) - Ethan Fang
|
||||
|
||||
Ethan helped run PowerToys and worked on improving and prototyping out next generation PowerToys
|
||||
|
||||
### [@franky920920](https://github.com/franky920920) - [Franky Chen](https://frankychen.net)
|
||||
|
||||
Franky has helped triaging, discussing, and creating a substantial number of issues and contributed features/fixes to PowerToys.
|
||||
|
||||
### [@htcfreek](https://github.com/htcfreek) - Heiko
|
||||
|
||||
Heiko has helped triaging, discussing, and creating a substantial number of issues and contributed features/fixes to PowerToys.
|
||||
|
||||
### [@Jay-o-Way](https://github.com/Jay-o-Way) - Jay
|
||||
|
||||
Jay has helped triaging, discussing, creating a substantial number of issues and PRs.
|
||||
|
||||
### [@jefflord](https://github.com/Jjefflord) - Jeff Lord
|
||||
Jeff added in multiple new features into Keyboard manager, such as key chord support and launching apps. He also contributed multiple features/fixes to PowerToys.
|
||||
|
||||
Jeff added multiple new features to Keyboard Manager, such as key chord support and launching apps. He also contributed multiple features/fixes to PowerToys.
|
||||
|
||||
### [@snickler](https://github.com/snickler) - [Jeremy Sinclair](http://sinclairinat0r.com)
|
||||
Jeremy has helped drive large sums of the ARM64 support inside PowerToys
|
||||
|
||||
Jeremy has helped drive substantial ARM64 support within PowerToys.
|
||||
|
||||
### [@jiripolasek](https://github.com/jiripolasek) - [Jiří Polášek](https://github.com/jiripolasek)
|
||||
|
||||
Jiří has contributed a massive number of features and improvements to Command Palette, including drag & drop support, custom themes, Web Search enhancements, Remote Desktop extension fixes, and many UX improvements.
|
||||
|
||||
### [@TheJoeFin](https://github.com/TheJoeFin) - [Joe Finney](https://joefinapps.com)
|
||||
Joe has helped triaging, discussing, issues as well as fixing bugs and building features for Text Extractor.
|
||||
|
||||
Joe has helped with triaging, discussing issues as well as fixing bugs and building features for Text Extractor.
|
||||
|
||||
### [@joadoumie](https://github.com/joadoumie) - Jordi Adoumie
|
||||
|
||||
Jordi helped innovate amazing new features into Advanced Paste and helped create Command Palette (PowerToys Run v2)
|
||||
|
||||
|
||||
### [@jsoref](https://github.com/jsoref) - [Josh Soref](https://check-spelling.dev/)
|
||||
|
||||
Helping keep our spelling correct :)
|
||||
|
||||
### [@martinchrzan](https://github.com/martinchrzan/) - Martin Chrzan
|
||||
|
||||
Color Picker is from Martin.
|
||||
|
||||
### [@mikeclayton](https://github.com/mikeclayton) - [Michael Clayton](https://michael-clayton.com)
|
||||
|
||||
Michael contributed the [initial version](https://github.com/microsoft/PowerToys/issues/23216) of the Mouse Jump tool and [a number of updates](https://github.com/microsoft/PowerToys/pulls?q=is%3Apr+author%3Amikeclayton) based on his FancyMouse utility.
|
||||
|
||||
### [@Noraa-Junker](https://github.com/Noraa-Junker) - [Noraa Junker](https://noraajunker.ch)
|
||||
|
||||
Noraa has helped triaging, discussing, and creating a substantial number of issues and contributed features/fixes. Noraa was the primary person for helping build the File Explorer preview pane handler for developer files.
|
||||
|
||||
### [@pedrolamas](https://github.com/pedrolamas/) - Pedro Lamas
|
||||
Pedro helped create the thumbnail and File Explorer previewers for 3D files like STL and GCode. If you like 3D printing, these are very helpful.
|
||||
|
||||
Pedro helped create the thumbnail and File Explorer previewers for 3D files like STL and GCode. If you like 3D printing, these are very helpful.
|
||||
|
||||
### [@PesBandi](https://github.com/PesBandi/) - PesBandi
|
||||
|
||||
PesBandi has helped do massive amounts of Quick Accent and bug fixes.
|
||||
|
||||
### [@riverar](https://github.com/riverar) - [Rafael Rivera](https://withinrafael.com/)
|
||||
Rafael has helped do the [upgrade from CppWinRT 1.x to 2.0](https://github.com/microsoft/PowerToys/issues/1907). He directly provided feedback to the CppWinRT team for bugs from this migration as well.
|
||||
|
||||
Rafael has helped do the [upgrade from CppWinRT 1.x to 2.0](https://github.com/microsoft/PowerToys/issues/1907). He directly provided feedback to the CppWinRT team for bugs from this migration as well.
|
||||
|
||||
### [@royvou](https://github.com/royvou)
|
||||
|
||||
Roy has helped out contributing multiple features to PowerToys Run
|
||||
|
||||
### [@ThiefZero](https://github.com/ThiefZero)
|
||||
ThiefZero has helped out contributing a features to PowerToys Run such as the unit converter plugin
|
||||
|
||||
ThiefZero has helped contribute features to PowerToys Run, such as the unit converter plugin
|
||||
|
||||
### [@TobiasSekan](https://github.com/TobiasSekan) - Tobias Sekan
|
||||
|
||||
Tobias Sekan has helped out contributing features to PowerToys Run such as Settings plugin, Registry plugin
|
||||
|
||||
## Open source projects
|
||||
@@ -94,7 +119,8 @@ Their fork of Wox was the base of PowerToys Run.
|
||||
Initial base of jjw24's fork, which makes it the base of PowerToys Run.
|
||||
|
||||
### [Text-Grab](https://github.com/TheJoeFin/Text-Grab) - Joseph Finney
|
||||
Joe helped develop and contribute to the Text Extractor utility. It is directly based on his Text Grab application.
|
||||
|
||||
Joe helped develop and contribute to the Text Extractor utility. It is directly based on his Text Grab application.
|
||||
|
||||
## Microsoft community members
|
||||
|
||||
@@ -102,7 +128,7 @@ We would like to also directly call out some extremely helpful Microsoft employe
|
||||
|
||||
### [@betsegaw](https://github.com/betsegaw/) - [Betsegaw Tadele](http://www.dreamsofameaningfullife.com/)
|
||||
|
||||
Window Walker, inside PowerToys Run, is from Beta.
|
||||
Window Walker, inside PowerToys Run, is from Beta.
|
||||
|
||||
### [@TheMrJukes](https://github.com/TheMrJukes/) - Bret Anderson
|
||||
|
||||
@@ -125,6 +151,7 @@ PowerToys Awake is a tool to keep your computer awake.
|
||||
Randy contributed Registry Preview and some very early conversations about keyboard remapping.
|
||||
|
||||
### [@cinnamon-msft](https://github.com/cinnamon-msft) - Kayla Cinnamon
|
||||
|
||||
Kayla was a former lead for PowerToys and helped create multiple utilities, maintained the GitHub repo, and collaborated with the community to improve the overall product
|
||||
|
||||
### [@oldnewthing](https://github.com/oldnewthing) - Raymond Chen
|
||||
@@ -135,46 +162,48 @@ Find My Mouse is based on Raymond Chen's SuperSonar.
|
||||
|
||||
Crop And Lock is based on the original work of Robert Mikhayelyan, with Program Manager support from [@kevinguo305](https://github.com/kevinguo305) - Kevin Guo.
|
||||
|
||||
ZoomIt's Video Recording Session code is based on Robert Mikhayelyan's https://github.com/robmikh/capturevideosample code.
|
||||
ZoomIt's Video Recording Session code is based on Robert Mikhayelyan's <https://github.com/robmikh/capturevideosample> code.
|
||||
|
||||
### Microsoft InVEST team
|
||||
|
||||
This amazing team helped PowerToys develop PowerToys Run and Keyboard manager as well as update our Settings to v2. @alekhyareddy28, @arjunbalgovind, @jyuwono @laviusmotileng-ms, @ryanbodrug-microsoft, @saahmedm, @somil55, @traies, @udit3333
|
||||
This amazing team helped PowerToys develop PowerToys Run and Keyboard manager as well as update our Settings to v2. @alekhyareddy28, @arjunbalgovind, @jyuwono @laviusmotileng-ms, @ryanbodrug-microsoft, @saahmedm, @somil55, @traies, @udit3333
|
||||
|
||||
## Mouse Without Borders original contributors
|
||||
*Project creator: Truong Do (Đỗ Đức Trường)*
|
||||
|
||||
Project creator: Truong Do (Đỗ Đức Trường)
|
||||
|
||||
Other contributors:
|
||||
* Microsoft Garage: Quinn Hawkins, Michael Low, Joe Coplen, Nino Yuniardi, Gwyneth Marshall, David Andrews, Karen Luecking
|
||||
* Peter Hauge - Visual Studio
|
||||
* Bruce Dawson - Windows Fundamentals
|
||||
* Alan Myrvold - Office Security
|
||||
* Adrian Garside - WEX
|
||||
* Scott Bradner - Surface
|
||||
* Aleks Gershaft - Windows Azure
|
||||
* Chinh Huynh - Windows Azure
|
||||
* Long Nguyen - Data Center
|
||||
* Triet Le - Cloud Engineering
|
||||
* Luke Schoen - Excel
|
||||
* Bao Nguyen - Bing
|
||||
* Ross Nichols - Windows
|
||||
* Ryan Baltazar - Windows
|
||||
* Ed Essey - The Garage
|
||||
* Mario Madden - The Garage
|
||||
* Karthick Mahalingam - ACE
|
||||
* Pooja Kamra - ACE
|
||||
* Justin White - SA
|
||||
* Chris Ransom - SA
|
||||
* Mike Ricks - Red Team
|
||||
* Randy Santossio - Surface
|
||||
* Ashish Sen Jaswal - Device Health
|
||||
* Zoltan Harmath - Security Tools
|
||||
* Luciano Krigun - Security Products
|
||||
* Jo Hemmerlein - Red Team
|
||||
* Chris Johnson - Surface Hub
|
||||
* Loren Ponten - Surface Hub
|
||||
* Paul Schmitt - WWL
|
||||
* And many other Users!
|
||||
|
||||
- Microsoft Garage: Quinn Hawkins, Michael Low, Joe Coplen, Nino Yuniardi, Gwyneth Marshall, David Andrews, Karen Luecking
|
||||
- Peter Hauge - Visual Studio
|
||||
- Bruce Dawson - Windows Fundamentals
|
||||
- Alan Myrvold - Office Security
|
||||
- Adrian Garside - WEX
|
||||
- Scott Bradner - Surface
|
||||
- Aleks Gershaft - Windows Azure
|
||||
- Chinh Huynh - Windows Azure
|
||||
- Long Nguyen - Data Center
|
||||
- Triet Le - Cloud Engineering
|
||||
- Luke Schoen - Excel
|
||||
- Bao Nguyen - Bing
|
||||
- Ross Nichols - Windows
|
||||
- Ryan Baltazar - Windows
|
||||
- Ed Essey - The Garage
|
||||
- Mario Madden - The Garage
|
||||
- Karthick Mahalingam - ACE
|
||||
- Pooja Kamra - ACE
|
||||
- Justin White - SA
|
||||
- Chris Ransom - SA
|
||||
- Mike Ricks - Red Team
|
||||
- Randy Santossio - Surface
|
||||
- Ashish Sen Jaswal - Device Health
|
||||
- Zoltan Harmath - Security Tools
|
||||
- Luciano Krigun - Security Products
|
||||
- Jo Hemmerlein - Red Team
|
||||
- Chris Johnson - Surface Hub
|
||||
- Loren Ponten - Surface Hub
|
||||
- Paul Schmitt - WWL
|
||||
- And many other Users!
|
||||
|
||||
## ZoomIt original contributors
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# PowerToys Contributor's Guide
|
||||
# PowerToys contributor's guide
|
||||
|
||||
Below is our guidance for reporting issues, proposing new features, and submitting contributions via Pull Requests (PRs). Our philosophy is to understand the problem and scenarios first, which is why we follow this pattern before work starts.
|
||||
|
||||
@@ -6,46 +6,46 @@ Below is our guidance for reporting issues, proposing new features, and submitti
|
||||
2. There has been a conversation.
|
||||
3. There is agreement on the problem, the fit for PowerToys, and the solution to the problem (implementation).
|
||||
|
||||
## Filing an Issue
|
||||
## Filing an issue
|
||||
|
||||
**Importance of Filing an Issue First**
|
||||
|
||||
Please follow this rule to help eliminate wasted effort and frustration, and to ensure an efficient and effective use of everyone’s time:
|
||||
Please follow this rule to help eliminate wasted effort and frustration, and to ensure an efficient and effective use of everyone's time:
|
||||
|
||||
> 👉 If you have a question, think you've discovered an issue, or would like to propose a new feature, please find/file an issue **BEFORE** starting work to fix/implement it.
|
||||
|
||||
When requesting new features or enhancements, providing additional evidence, data, tweets, blog posts, or research is extremely helpful. This information gives context to the scenario that may otherwise be lost.
|
||||
|
||||
* Unsure whether it’s an issue or feature request? File an issue.
|
||||
* Have a question that isn't answered in the docs, videos, etc.? File an issue.
|
||||
* Want to know if we’re planning a particular feature? File an issue.
|
||||
* Got a great idea for a new utility or feature? File an issue/request/idea.
|
||||
* Don’t understand how to do something? File an issue/Community Guidance Request.
|
||||
* Found an existing issue that describes yours? Great! Upvote and add additional commentary, info, or repro steps.
|
||||
- Unsure whether it's an issue or feature request? File an issue.
|
||||
- Have a question that isn't answered in the docs, videos, etc.? File an issue.
|
||||
- Want to know if we're planning a particular feature? File an issue.
|
||||
- Got a great idea for a new utility or feature? File an issue/request/idea.
|
||||
- Don't understand how to do something? File an issue/Community Guidance Request.
|
||||
- Found an existing issue that describes yours? Great! Upvote and add additional commentary, info, or repro steps.
|
||||
|
||||
A quick search before filing an issue could be helpful. It’s likely someone else has found the same problem, and they may even be working on or have already contributed a fix!
|
||||
A quick search before filing an issue could be helpful. It's likely someone else has found the same problem, and they may even be working on or have already contributed a fix!
|
||||
|
||||
### Indicating Interest in Issues
|
||||
### Indicating interest in issues
|
||||
|
||||
To let the team know which issues are important, upvote by clicking the [+😊] button and the 👍 icon on the original issue post. Avoid comments like "+1" or "me too" as they clutter the discussion and make it harder to prioritize requests.
|
||||
|
||||
---
|
||||
|
||||
## Contributing Fixes/Features
|
||||
## Contributing fixes or features
|
||||
|
||||
Please comment on our ["Would you like to contribute to PowerToys?"](https://github.com/microsoft/PowerToys/issues/28769) thread to let us know you're interested in working on something before you start. This helps avoid multiple people unexpectedly working on the same thing and ensures everyone is clear on what should be done. It's less work for everyone to establish this up front.
|
||||
Please comment on our [Would you like to contribute to PowerToys?](https://github.com/microsoft/PowerToys/issues/28769) thread to let us know you're interested in working on something before you start. This helps avoid multiple people unexpectedly working on the same thing and ensures everyone is clear on what should be done. It's less work for everyone to establish this up front.
|
||||
|
||||
### Localization Issues
|
||||
### Localization issues
|
||||
|
||||
For localization issues, please file an issue to notify our internal localization team, as community PRs for localization aren't accepted. Localization is handled exclusively by the internal Microsoft team.
|
||||
|
||||
### To Spec or Not to Spec
|
||||
### To spec or not to spec
|
||||
|
||||
A key point is for everyone to understand the approach that will be taken. We want to be sure that any work done will be accepted. Larger-scope items will require a spec to outline the approach and allow for discussion. Specs help collaborators consider different solutions, describe feature behavior, and plan for errors. Achieving agreement in a spec before writing code often results in simpler code and less wasted effort.
|
||||
|
||||
Once a team member has agreed with your approach, proceed to the "Development" section below. Team members are happy to help review specs and guide them to completion.
|
||||
|
||||
### Help Wanted
|
||||
### Help wanted
|
||||
|
||||
Once the team has approved an issue/spec approach, development can proceed. If no developers are immediately available, the spec may be parked and labeled "Help Wanted," ready for a developer to get started. For development opportunities, visit [Issues labeled Help Wanted](https://github.com/microsoft/PowerToys/labels/Help%20Wanted).
|
||||
|
||||
@@ -55,18 +55,18 @@ Once the team has approved an issue/spec approach, development can proceed. If n
|
||||
|
||||
Follow the [development guidelines](https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/readme.md).
|
||||
|
||||
### Naming Features and Functionality
|
||||
### Naming features and functionality
|
||||
|
||||
Names should be descriptive and straightforward, clearly reflecting functionality and usefulness.
|
||||
|
||||
### Becoming a Collaborator on the PowerToys Team
|
||||
### Becoming a collaborator on the PowerToys team
|
||||
|
||||
Be an active community member! Make helpful contributions by filing bugs, offering suggestions, developing fixes and features, conducting code reviews, and updating documentation.
|
||||
Be an active community member! Make helpful contributions by filing bugs, offering suggestions, developing fixes and features, conducting code reviews, and updating documentation.
|
||||
|
||||
When the time comes, Microsoft will reach out to you about becoming a formal team member. Just make sure they have a way to contact you. 😊
|
||||
|
||||
---
|
||||
|
||||
## Thank You
|
||||
## Thank you
|
||||
|
||||
Thank you in advance for your contribution! We appreciate your help in making PowerToys a better tool for everyone.
|
||||
|
||||
1698
DATA_AND_PRIVACY.md
1698
DATA_AND_PRIVACY.md
File diff suppressed because it is too large
Load Diff
@@ -18,14 +18,14 @@
|
||||
<PackageVersion Include="SixLabors.ImageSharp" Version="2.1.12" />
|
||||
<PackageVersion Include="CommunityToolkit.Common" Version="8.4.0" />
|
||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Animations" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Collections" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.2.250402" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Animations" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Collections" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Converters" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.Extensions" Version="8.2.251219" />
|
||||
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
|
||||
<PackageVersion Include="CommunityToolkit.Labs.WinUI.Controls.MarkdownTextBlock" Version="0.1.260116-build.2514" />
|
||||
<PackageVersion Include="ControlzEx" Version="6.0.0" />
|
||||
@@ -40,7 +40,6 @@
|
||||
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
|
||||
<PackageVersion Include="MessagePack" Version="3.1.3" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
|
||||
<PackageVersion Include="Microsoft.CommandPalette.Extensions" Version="0.9.260303001" />
|
||||
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.10" />
|
||||
<!-- Including Microsoft.Bcl.AsyncInterfaces to force version, since it's used by Microsoft.SemanticKernel. -->
|
||||
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.10" />
|
||||
@@ -76,7 +75,7 @@
|
||||
This is present due to a bug in CsWinRT where WPF projects cause the analyzer to fail.
|
||||
-->
|
||||
<PackageVersion Include="Microsoft.Windows.CsWinRT" Version="2.2.0" />
|
||||
<PackageVersion Include="Microsoft.Windows.ImplementationLibrary" Version="1.0.231216.1"/>
|
||||
<PackageVersion Include="Microsoft.Windows.ImplementationLibrary" Version="1.0.250325.1"/>
|
||||
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.6901" />
|
||||
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.8.260209005" />
|
||||
<PackageVersion Include="Microsoft.WindowsAppSDK.Foundation" Version="1.8.260203002" />
|
||||
|
||||
87
NOTICE.md
87
NOTICE.md
@@ -17,7 +17,7 @@ This software incorporates material from third parties.
|
||||
|
||||
### Martin Chrzan's Color Picker
|
||||
|
||||
**Source**: https://github.com/martinchrzan/ColorPicker
|
||||
**Source**: <https://github.com/martinchrzan/ColorPicker>
|
||||
|
||||
MIT License
|
||||
|
||||
@@ -49,7 +49,7 @@ We use the WyHash NuGet package for calculating stable hashes for strings.
|
||||
|
||||
**Source**: [https://github.com/wangyi-fudan/wyhash](https://github.com/wangyi-fudan/wyhash)
|
||||
|
||||
```
|
||||
```text
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
@@ -82,7 +82,7 @@ We use the ToolGood.Words.Pinyin NuGet package for converting Chinese characters
|
||||
|
||||
**Source**: [https://github.com/toolgood/ToolGood.Words.Pinyin](https://github.com/toolgood/ToolGood.Words.Pinyin)
|
||||
|
||||
```
|
||||
```text
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 ToolGood
|
||||
@@ -106,8 +106,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
|
||||
|
||||
## Utility: Command Palette Built-in Extensions
|
||||
## Utility: Command palette built-in extensions
|
||||
|
||||
### Calculator
|
||||
|
||||
@@ -117,7 +116,7 @@ We use the exprtk library (exprtk.hpp) to evaluate mathematical expressions.
|
||||
|
||||
**Source**: [https://github.com/ArashPartow/exprtk](https://github.com/ArashPartow/exprtk)
|
||||
|
||||
```
|
||||
```text
|
||||
MIT License
|
||||
|
||||
Copyright (c) 1999-2024 Arash Partow
|
||||
@@ -144,7 +143,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
```
|
||||
|
||||
## Utility: PowerToys Run Built-in Extensions
|
||||
## Utility: PowerToys Run built-in extensions
|
||||
|
||||
### Calculator
|
||||
|
||||
@@ -154,7 +153,7 @@ We use the Mages NuGet package for calculating the result of expression.
|
||||
|
||||
**Source**: [https://github.com/FlorianRappl/Mages](https://github.com/FlorianRappl/Mages)
|
||||
|
||||
```
|
||||
```text
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 - 2025 Florian Rappl
|
||||
@@ -178,13 +177,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
```
|
||||
|
||||
## Utility: File Explorer Add-ins
|
||||
## Utility: File Explorer add-ins
|
||||
|
||||
### Monaco Editor
|
||||
|
||||
**Source**: https://github.com/Microsoft/monaco-editor
|
||||
**Source**: <https://github.com/Microsoft/monaco-editor>
|
||||
|
||||
**Additional third party notifications:** https://github.com/microsoft/monaco-editor/blob/main/ThirdPartyNotices.txt
|
||||
**Additional third party notifications:** <https://github.com/microsoft/monaco-editor/blob/main/ThirdPartyNotices.txt>
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -208,9 +207,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
### The Quite OK Image Format reference decoder
|
||||
### The Quite OK image format reference decoder
|
||||
|
||||
**Source**: https://github.com/phoboslab/qoi
|
||||
**Source**: <https://github.com/phoboslab/qoi>
|
||||
|
||||
**Note**: [@pedrolamas](https://github.com/pedrolamas) translated and adapted the reference decoder code to C# that is in PowerToys from the original C++ implementation.
|
||||
|
||||
@@ -240,9 +239,9 @@ SOFTWARE.
|
||||
|
||||
We use the UTF.Unknown NuGet package for detecting encoding in text/code files.
|
||||
|
||||
**Source**: https://github.com/CharsetDetector/UTF-unknown
|
||||
**Source**: <https://github.com/CharsetDetector/UTF-unknown>
|
||||
|
||||
```
|
||||
```text
|
||||
MOZILLA PUBLIC LICENSE
|
||||
Version 1.1
|
||||
|
||||
@@ -716,9 +715,9 @@ EXHIBIT A -Mozilla Public License.
|
||||
|
||||
## Utility: ImageResizer
|
||||
|
||||
### Brice Lams's Image Resizer License
|
||||
### Brice Lams's Image Resizer license
|
||||
|
||||
**Source**: https://github.com/bricelam/ImageResizer/
|
||||
**Source**: <https://github.com/bricelam/ImageResizer/>
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -744,10 +743,10 @@ THE SOFTWARE.
|
||||
|
||||
## Utility: PowerToys Run
|
||||
|
||||
### Wox License
|
||||
### Wox license
|
||||
|
||||
**Fork project source**: https://github.com/jjw24/Wox/
|
||||
**Base project source**: https://github.com/Wox-launcher/Wox
|
||||
**Fork project source**: <https://github.com/jjw24/Wox/>
|
||||
**Base project source**: <https://github.com/Wox-launcher/Wox>
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -770,9 +769,9 @@ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
### Beta Tadele's Window Walker License
|
||||
### Beta Tadele's Window Walker license
|
||||
|
||||
**Source**: https://github.com/betsegaw/windowwalker
|
||||
**Source**: <https://github.com/betsegaw/windowwalker>
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -786,9 +785,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
|
||||
## Utility: PowerRename
|
||||
|
||||
### Chris Davis's SmartRename License
|
||||
### Chris Davis's SmartRename license
|
||||
|
||||
**Source**: https://github.com/chrdavis/SmartRename
|
||||
**Source**: <https://github.com/chrdavis/SmartRename>
|
||||
|
||||
MIT License
|
||||
|
||||
@@ -816,7 +815,7 @@ SOFTWARE.
|
||||
|
||||
### spdlog
|
||||
|
||||
**Source**: https://github.com/gabime/spdlog
|
||||
**Source**: <https://github.com/gabime/spdlog>
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -841,12 +840,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
-- NOTE: Third party dependency used by this software --
|
||||
This software depends on the fmt lib (MIT License),
|
||||
and users must comply to its license: https://github.com/fmtlib/fmt/blob/master/LICENSE.rst
|
||||
This software depends on the fmt lib (MIT License), and users must comply to its license:
|
||||
<https://github.com/fmtlib/fmt/blob/master/LICENSE.rst>
|
||||
|
||||
### expected-lite
|
||||
|
||||
**Source**: https://github.com/martinmoene/expected-lite
|
||||
**Source**: <https://github.com/martinmoene/expected-lite>
|
||||
|
||||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
@@ -874,7 +873,7 @@ DEALINGS IN THE SOFTWARE.
|
||||
|
||||
### zip
|
||||
|
||||
**Source**: https://github.com/kuba--/zip
|
||||
**Source**: <https://github.com/kuba--/zip>
|
||||
|
||||
All Rights Reserved.
|
||||
|
||||
@@ -902,7 +901,7 @@ THE SOFTWARE.
|
||||
|
||||
We adopted some functions from it.
|
||||
|
||||
**Source**: https://github.com/DLTcollab/sse2neon
|
||||
**Source**: <https://github.com/DLTcollab/sse2neon>
|
||||
|
||||
sse2neon is freely redistributable under the MIT License.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
@@ -925,9 +924,9 @@ SOFTWARE.
|
||||
|
||||
### Monaco Editor
|
||||
|
||||
**Source**: https://github.com/Microsoft/monaco-editor
|
||||
**Source**: <https://github.com/Microsoft/monaco-editor>
|
||||
|
||||
**Additional third party notifications:** https://github.com/microsoft/monaco-editor/blob/main/ThirdPartyNotices.txt
|
||||
**Additional third party notifications:** <https://github.com/microsoft/monaco-editor/blob/main/ThirdPartyNotices.txt>
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -951,11 +950,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
### The Quite OK Image Format reference decoder
|
||||
### The Quite OK image format reference decoder
|
||||
|
||||
**Source**: https://github.com/phoboslab/qoi
|
||||
**Source**: <https://github.com/phoboslab/qoi>
|
||||
|
||||
**Note**: [@pedrolamas](https://github.com/pedrolamas) translated and adapted the reference decoder code to C# that is in PowerToys from the original C++ implementation.
|
||||
**Note**: [@pedrolamas](https://github.com/pedrolamas) translated and adapted the reference decoder code to C# that is in PowerToys, from the original C++ implementation.
|
||||
|
||||
MIT License
|
||||
|
||||
@@ -979,13 +978,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
### UTF Unknown
|
||||
### UTF unknown
|
||||
|
||||
We use the UTF.Unknown NuGet package for detecting encoding in text/code files.
|
||||
|
||||
**Source**: https://github.com/CharsetDetector/UTF-unknown
|
||||
**Source**: <https://github.com/CharsetDetector/UTF-unknown>
|
||||
|
||||
```
|
||||
```text
|
||||
MOZILLA PUBLIC LICENSE
|
||||
Version 1.1
|
||||
|
||||
@@ -1463,9 +1462,9 @@ EXHIBIT A -Mozilla Public License.
|
||||
|
||||
We use HexBox.WinUI to show a preview of binary values.
|
||||
|
||||
**Source**: https://github.com/hotkidfamily/HexBox.WinUI
|
||||
**Source**: <https://github.com/hotkidfamily/HexBox.WinUI>
|
||||
|
||||
```
|
||||
```text
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Filip Jeremic
|
||||
@@ -1492,11 +1491,11 @@ SOFTWARE.
|
||||
|
||||
### Monaco Editor
|
||||
|
||||
**Source**: https://github.com/Microsoft/monaco-editor
|
||||
**Source**: <https://github.com/Microsoft/monaco-editor>
|
||||
|
||||
**Additional third party notifications:** https://github.com/microsoft/monaco-editor/blob/main/ThirdPartyNotices.txt
|
||||
**Additional third party notifications:** <https://github.com/microsoft/monaco-editor/blob/main/ThirdPartyNotices.txt>
|
||||
|
||||
```
|
||||
```text
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2016 - present Microsoft Corporation
|
||||
@@ -1526,7 +1525,7 @@ SOFTWARE.
|
||||
|
||||
PowerDisplay's DDC/CI implementation references techniques from Twinkle Tray.
|
||||
|
||||
**Source**: https://github.com/xanderfrangos/twinkle-tray
|
||||
**Source**: <https://github.com/xanderfrangos/twinkle-tray>
|
||||
|
||||
MIT License
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
<Project Path="src/common/UnitTests-CommonLib/UnitTests-CommonLib.vcxproj" Id="1a066c63-64b3-45f8-92fe-664e1cce8077" />
|
||||
<Project Path="src/common/UnitTests-CommonUtils/UnitTests-CommonUtils.vcxproj" Id="8b5cfb38-ccba-40a8-ad7a-89c57b070884" />
|
||||
<Project Path="src/common/updating/updating.vcxproj" Id="17da04df-e393-4397-9cf0-84dabe11032e" />
|
||||
<Project Path="src/common/updating/UnitTests/UpdatingUnitTests.vcxproj" Id="a1b2c3d4-e5f6-7890-abcd-ef1234567890" />
|
||||
<Project Path="src/common/version/version.vcxproj" Id="cc6e41ac-8174-4e8a-8d22-85dd7f4851df" />
|
||||
</Folder>
|
||||
<Folder Name="/common/interop/">
|
||||
@@ -427,7 +428,7 @@
|
||||
</Project>
|
||||
</Folder>
|
||||
<Folder Name="/modules/FileLocksmith/">
|
||||
<Project Path="src/modules/FileLocksmith/FileLocksmithCLI/FileLocksmithCLI.vcxproj" Id="49D456D3-F485-45AF-8875-45B44F193DDC" />
|
||||
<Project Path="src/modules/FileLocksmith/FileLocksmithCLI/FileLocksmithCLI.vcxproj" Id="49d456d3-f485-45af-8875-45b44f193ddc" />
|
||||
<Project Path="src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj" Id="799a50d8-de89-4ed1-8ff8-ad5a9ed8c0ca" />
|
||||
<Project Path="src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj" Id="57175ec7-92a5-4c1e-8244-e3fbca2a81de" />
|
||||
<Project Path="src/modules/FileLocksmith/FileLocksmithLib/FileLocksmithLib.vcxproj" Id="9d52fd25-ef90-4f9a-a015-91efc5daf54f" />
|
||||
@@ -438,7 +439,7 @@
|
||||
</Project>
|
||||
</Folder>
|
||||
<Folder Name="/modules/FileLocksmith/Tests/">
|
||||
<Project Path="src/modules/FileLocksmith/FileLocksmithCLI/tests/FileLocksmithCLIUnitTests.vcxproj" Id="A1B2C3D4-E5F6-7890-1234-567890ABCDEF" />
|
||||
<Project Path="src/modules/FileLocksmith/FileLocksmithCLI/tests/FileLocksmithCLIUnitTests.vcxproj" Id="a1b2c3d4-e5f6-7890-1234-567890abcdef" />
|
||||
</Folder>
|
||||
<Folder Name="/modules/Hosts/">
|
||||
<Project Path="src/modules/Hosts/Hosts/Hosts.csproj">
|
||||
@@ -464,13 +465,13 @@
|
||||
</Folder>
|
||||
<Folder Name="/modules/imageresizer/">
|
||||
<Project Path="src/modules/imageresizer/dll/ImageResizerExt.vcxproj" Id="0b43679e-edfa-4da0-ad30-f4628b308b1b" />
|
||||
<Project Path="src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj" Id="93b72a06-c8bd-484f-a6f7-c9f280b150bf" />
|
||||
<Project Path="src/modules/imageresizer/ImageResizerLib/ImageResizerLib.vcxproj" Id="18b3db45-4ffe-4d01-97d6-5223feee1853" />
|
||||
<Project Path="src/modules/imageresizer/ui/ImageResizerUI.csproj">
|
||||
<Project Path="src/modules/imageresizer/ImageResizerCLI/ImageResizerCLI.csproj">
|
||||
<Platform Solution="*|ARM64" Project="ARM64" />
|
||||
<Platform Solution="*|x64" Project="x64" />
|
||||
</Project>
|
||||
<Project Path="src/modules/imageresizer/ImageResizerCLI/ImageResizerCLI.csproj">
|
||||
<Project Path="src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj" Id="93b72a06-c8bd-484f-a6f7-c9f280b150bf" />
|
||||
<Project Path="src/modules/imageresizer/ImageResizerLib/ImageResizerLib.vcxproj" Id="18b3db45-4ffe-4d01-97d6-5223feee1853" />
|
||||
<Project Path="src/modules/imageresizer/ui/ImageResizerUI.csproj">
|
||||
<Platform Solution="*|ARM64" Project="ARM64" />
|
||||
<Platform Solution="*|x64" Project="x64" />
|
||||
</Project>
|
||||
@@ -497,7 +498,7 @@
|
||||
<Project Path="src/modules/keyboardmanager/KeyboardManagerEngine/KeyboardManagerEngine.vcxproj" Id="ba661f5b-1d5a-4ffc-9bf1-fc39df280bdd" />
|
||||
<Project Path="src/modules/keyboardmanager/KeyboardManagerEngineLibrary/KeyboardManagerEngineLibrary.vcxproj" Id="e496b7fc-1e99-4bab-849b-0e8367040b02" />
|
||||
</Folder>
|
||||
<Folder Name="/modules/keyboardmanager/MouseUtils/">
|
||||
<Folder Name="/modules/MouseUtils/">
|
||||
<Project Path="src/modules/MouseUtils/CursorWrap/CursorWrap.vcxproj" Id="48a1db8c-5df8-4fb3-9e14-2b67f3f2d8b5" />
|
||||
<Project Path="src/modules/MouseUtils/FindMyMouse/FindMyMouse.vcxproj" Id="e94fd11c-0591-456f-899f-efc0ca548336" />
|
||||
<Project Path="src/modules/MouseUtils/MouseHighlighter/MouseHighlighter.vcxproj" Id="782a61be-9d85-4081-b35c-1ccc9dcc1e88" />
|
||||
@@ -512,7 +513,7 @@
|
||||
</Project>
|
||||
<Project Path="src/modules/MouseUtils/MousePointerCrosshairs/MousePointerCrosshairs.vcxproj" Id="eae14c0e-7a6b-45da-9080-a7d8c077ba6e" />
|
||||
</Folder>
|
||||
<Folder Name="/modules/keyboardmanager/MouseUtils/Tests/">
|
||||
<Folder Name="/modules/MouseUtils/Tests/">
|
||||
<Project Path="src/modules/MouseUtils/MouseJump.Common.UnitTests/MouseJump.Common.UnitTests.csproj">
|
||||
<Platform Solution="*|ARM64" Project="ARM64" />
|
||||
<Platform Solution="*|x64" Project="x64" />
|
||||
@@ -709,17 +710,19 @@
|
||||
</Project>
|
||||
</Folder>
|
||||
<Folder Name="/modules/PowerDisplay/">
|
||||
<Project Path="src/modules/powerdisplay/PowerDisplay.Models/PowerDisplay.Models.csproj">
|
||||
<Platform Solution="*|ARM64" Project="ARM64" />
|
||||
<Platform Solution="*|x64" Project="x64" />
|
||||
</Project>
|
||||
<Project Path="src/modules/powerdisplay/PowerDisplay.Lib/PowerDisplay.Lib.csproj">
|
||||
<Platform Solution="*|ARM64" Project="ARM64" />
|
||||
<Platform Solution="*|x64" Project="x64" />
|
||||
</Project>
|
||||
<!-- TEMPORARILY_DISABLED: PowerDisplay
|
||||
<Project Path="src/modules/powerdisplay/PowerDisplay/PowerDisplay.csproj">
|
||||
<Platform Solution="*|ARM64" Project="ARM64" />
|
||||
<Platform Solution="*|x64" Project="x64" />
|
||||
</Project>
|
||||
<Project Path="src/modules/powerdisplay/PowerDisplayModuleInterface/PowerDisplayModuleInterface.vcxproj" Id="d1234567-8901-2345-6789-abcdef012345" />
|
||||
-->
|
||||
</Folder>
|
||||
<Folder Name="/modules/PowerDisplay/Tests/">
|
||||
<Project Path="src/modules/powerdisplay/PowerDisplay.Lib.UnitTests/PowerDisplay.Lib.UnitTests.csproj">
|
||||
@@ -1027,7 +1030,10 @@
|
||||
<File Path="src/modules/Workspaces/workspaces-common/WindowUtils.h" />
|
||||
</Folder>
|
||||
<Folder Name="/modules/ZoomIt/">
|
||||
<Project Path="src/modules/ZoomIt/ZoomIt/ZoomIt.vcxproj" Id="0a84f764-3a88-44cd-aa96-41bdbd48627b" />
|
||||
<Project Path="src/modules/ZoomIt/ZoomIt/ZoomIt.vcxproj" Id="0a84f764-3a88-44cd-aa96-41bdbd48627b">
|
||||
<BuildDependency Project="src/modules/ZoomIt/ZoomItBreak/ZoomItBreak.vcxproj" />
|
||||
</Project>
|
||||
<Project Path="src/modules/ZoomIt/ZoomItBreak/ZoomItBreak.vcxproj" Id="94ba3051-c8d7-454a-9d46-1a7c78e228a3" />
|
||||
<Project Path="src/modules/ZoomIt/ZoomItModuleInterface/ZoomItModuleInterface.vcxproj" Id="e4585179-2ac1-4d5f-a3ff-cfc5392f694c" />
|
||||
<Project Path="src/modules/ZoomIt/ZoomItSettingsInterop/ZoomItSettingsInterop.vcxproj" Id="ca7d8106-30b9-4aec-9d05-b69b31b8c461" />
|
||||
</Folder>
|
||||
|
||||
316
README.md
316
README.md
@@ -19,14 +19,13 @@
|
||||
<span> · </span>
|
||||
<a href="#-whats-new">Release notes</a>
|
||||
</h3>
|
||||
<br/><br/>
|
||||
|
||||
## 🔨 Utilities
|
||||
|
||||
PowerToys includes over 25 utilities to help you customize and optimize your Windows experience:
|
||||
PowerToys includes over 30 utilities to help you customize and optimize your Windows experience:
|
||||
|
||||
| | | |
|
||||
|---|---|---|
|
||||
| --- | --- | --- |
|
||||
| [<img src="doc/images/icons/AdvancedPaste.png" alt="Advanced Paste icon" height="16"> Advanced Paste](https://aka.ms/PowerToysOverview_AdvancedPaste) | [<img src="doc/images/icons/Always%20On%20Top.png" alt="Always on Top icon" height="16"> Always on Top](https://aka.ms/PowerToysOverview_AoT) | [<img src="doc/images/icons/Awake.png" alt="Awake icon" height="16"> Awake](https://aka.ms/PowerToysOverview_Awake) |
|
||||
| [<img src="doc/images/icons/Color%20Picker.png" alt="Color Picker icon" height="16"> Color Picker](https://aka.ms/PowerToysOverview_ColorPicker) | [<img src="doc/images/icons/Command%20Not%20Found.png" alt="Command Not Found icon" height="16"> Command Not Found](https://aka.ms/PowerToysOverview_CmdNotFound) | [<img src="doc/images/icons/Command Palette.png" alt="Command Palette icon" height="16"> Command Palette](https://aka.ms/PowerToysOverview_CmdPal) |
|
||||
| [<img src="doc/images/icons/Crop%20And%20Lock.png" alt="Crop and Lock icon" height="16"> Crop And Lock](https://aka.ms/PowerToysOverview_CropAndLock) | [<img src="doc/images/icons/Environment%20Manager.png" alt="Environment Variables icon" height="16"> Environment Variables](https://aka.ms/PowerToysOverview_EnvironmentVariables) | [<img src="doc/images/icons/FancyZones.png" alt="FancyZones icon" height="16"> FancyZones](https://aka.ms/PowerToysOverview_FancyZones) |
|
||||
@@ -38,32 +37,31 @@ PowerToys includes over 25 utilities to help you customize and optimize your Win
|
||||
| [<img src="doc/images/icons/Shortcut%20Guide.png" alt="Shortcut Guide icon" height="16"> Shortcut Guide](https://aka.ms/PowerToysOverview_ShortcutGuide) | [<img src="doc/images/icons/PowerOCR.png" alt="Text Extractor icon" height="16"> Text Extractor](https://aka.ms/PowerToysOverview_TextExtractor) | [<img src="doc/images/icons/Workspaces.png" alt="Workspaces icon" height="16"> Workspaces](https://aka.ms/PowerToysOverview_Workspaces) |
|
||||
| [<img src="doc/images/icons/ZoomIt.png" alt="ZoomIt icon" height="16"> ZoomIt](https://aka.ms/PowerToysOverview_ZoomIt) | | |
|
||||
|
||||
## 📦 Installation
|
||||
|
||||
## 📋 Installation
|
||||
|
||||
For detailed installation instructions and system requirements, visit the [installation docs](https://learn.microsoft.com/windows/powertoys/install).
|
||||
For detailed installation instructions and system requirements, visit the [installation docs](https://learn.microsoft.com/windows/powertoys/install).
|
||||
|
||||
But to get started quickly, choose one of the installation methods below:
|
||||
<br/><br/>
|
||||
<details open>
|
||||
<summary><strong>Download .exe from GitHub</strong></summary>
|
||||
<summary><strong>Download the .exe file from GitHub</strong></summary>
|
||||
<br/>
|
||||
Go to the <a href="https://aka.ms/installPowerToys">PowerToys GitHub releases</a>, click Assets to reveal the downloads, and choose the installer that matches your architecture and install scope. For most devices, that's the x64 per-user installer.
|
||||
|
||||
Go to the [PowerToys GitHub releases](https://aka.ms/installPowerToys), select **Assets** to reveal the installation files, and choose the one that matches your architecture and install scope. For most devices, that would be _x64 per-user_.
|
||||
|
||||
<!-- items that need to be updated release to release -->
|
||||
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aissue+milestone%3A%22PowerToys+0.98%22
|
||||
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aissue+milestone%3A%22PowerToys+0.97%22
|
||||
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.97.1/PowerToysUserSetup-0.97.1-x64.exe
|
||||
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.97.1/PowerToysUserSetup-0.97.1-arm64.exe
|
||||
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.97.1/PowerToysSetup-0.97.1-x64.exe
|
||||
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.97.1/PowerToysSetup-0.97.1-arm64.exe
|
||||
|
||||
| Description | Filename |
|
||||
|----------------|----------|
|
||||
| Per user - x64 | [PowerToysUserSetup-0.97.1-x64.exe][ptUserX64] |
|
||||
| Per user - ARM64 | [PowerToysUserSetup-0.97.1-arm64.exe][ptUserArm64] |
|
||||
| Machine wide - x64 | [PowerToysSetup-0.97.1-x64.exe][ptMachineX64] |
|
||||
| Machine wide - ARM64 | [PowerToysSetup-0.97.1-arm64.exe][ptMachineArm64] |
|
||||
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aissue+milestone%3A%22PowerToys+0.99%22
|
||||
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.98.1/PowerToysUserSetup-0.98.1-x64.exe
|
||||
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.98.1/PowerToysUserSetup-0.98.1-arm64.exe
|
||||
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.98.1/PowerToysSetup-0.98.1-x64.exe
|
||||
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.98.1/PowerToysSetup-0.98.1-arm64.exe
|
||||
|
||||
| Description | Filename |
|
||||
| --- | --- |
|
||||
| Per user - x64 | [PowerToysUserSetup-0.98.1-x64.exe][ptUserX64] |
|
||||
| Per user - ARM64 | [PowerToysUserSetup-0.98.1-arm64.exe][ptUserArm64] |
|
||||
| Machine wide - x64 | [PowerToysSetup-0.98.1-x64.exe][ptMachineX64] |
|
||||
| Machine wide - ARM64 | [PowerToysSetup-0.98.1-arm64.exe][ptMachineArm64] |
|
||||
|
||||
</details>
|
||||
|
||||
@@ -83,14 +81,16 @@ You can easily install PowerToys from the Microsoft Store:
|
||||
<details>
|
||||
<summary><strong>WinGet</strong></summary>
|
||||
<br/>
|
||||
Download PowerToys from <a href="https://github.com/microsoft/winget-cli#installing-the-client">WinGet</a>. Updating PowerToys via winget will respect the current PowerToys installation scope. To install PowerToys, run the following command from the command line / PowerShell:
|
||||
Download PowerToys from [WinGet](https://github.com/microsoft/winget-cli#installing-the-client). Updating PowerToys via winget will respect the current PowerToys installation scope. To install PowerToys, run the following command from the command line / PowerShell:
|
||||
|
||||
- User scope installer (default)
|
||||
|
||||
*User scope installer [default]*
|
||||
```powershell
|
||||
winget install Microsoft.PowerToys -s winget
|
||||
```
|
||||
|
||||
*Machine-wide scope installer*
|
||||
- Machine-wide scope installer
|
||||
|
||||
```powershell
|
||||
winget install --scope machine Microsoft.PowerToys -s winget
|
||||
```
|
||||
@@ -99,265 +99,35 @@ winget install --scope machine Microsoft.PowerToys -s winget
|
||||
<details>
|
||||
<summary><strong>Other methods</strong></summary>
|
||||
<br/>
|
||||
There are <a href="https://learn.microsoft.com/windows/powertoys/install#community-driven-install-tools">community driven install methods</a> such as Chocolatey and Scoop. If these are your preferred install solutions, you can find the install instructions there.
|
||||
There are [community driven install methods](https://learn.microsoft.com/windows/powertoys/install#community-driven-install-tools) such as Chocolatey and Scoop. If these are your preferred install solutions, you can find the install instructions there.
|
||||
</details>
|
||||
|
||||
## ✨ What's new
|
||||
## ✨ What's new?
|
||||
|
||||
**Version 0.97.2 (Feb 2026)**
|
||||
[](https://github.com/microsoft/PowerToys/releases)
|
||||
|
||||
This patch release fixes several important stability issues identified in v0.97.0 based on incoming reports. Check out the [v0.97.0](https://github.com/microsoft/PowerToys/releases/tag/v0.97.0) notes for the full list of changes.
|
||||
To see what's new, check out the [release notes](https://github.com/microsoft/PowerToys/releases/tag/v0.98.1).
|
||||
|
||||
## Advanced Paste
|
||||
- #45207 Fixed a crash in the Advanced Paste settings page caused by null values during JSON deserialization.
|
||||
## 🛣️ Roadmap
|
||||
|
||||
## Color Picker
|
||||
- #45367 Fixed contrast issue in Color picker UI.
|
||||
We are planning some nice new features and improvements for the next releases – PowerDisplay, Command Palette improvements and a brand-new Shortcut Guide experience! Stay tuned for [v0.99][github-next-release-work]!
|
||||
|
||||
## Command Palette
|
||||
- #45194 Fixed an issue where some Command Palette PowerToys Extension strings were not localised.
|
||||
## ❤️ PowerToys Community
|
||||
|
||||
## Cursor Wrap
|
||||
- #45210 Fixed "Automatically activate on utility startup" setting not persisting when disabled. Thanks [@ThanhNguyxn](https://github.com/ThanhNguyxn)!
|
||||
- #45303 Added option to disable Cursor Wrapping when only a single monitor is connected. Thanks [@mikehall-ms](https://github.com/mikehall-ms)!
|
||||
|
||||
## Image Resizer
|
||||
- #45184 Fixed Image Resizer not working after upgrading PowerToys on Windows 10 by properly cleaning up legacy sparse app packages.
|
||||
|
||||
## LightSwitch
|
||||
- #45304 Fixed Light Switch startup logic to correctly apply the appropriate theme on launch.
|
||||
|
||||
## Workspaces
|
||||
- #45183 Fixed overlay positioning issue in workspace snapshot draw caused by DPI-aware coordinate mismatch.
|
||||
|
||||
## Quick Access and Measure Tool
|
||||
- #45443 Fixed crash related to `IsShownInSwitchers` property when Explorer is not running.
|
||||
|
||||
**Version 0.97.1 (January 2026)**
|
||||
|
||||
**Highlights**
|
||||
|
||||
### Advanced Paste
|
||||
- #44862: Fixed Settings UI advanced paste page crash by using correct settings repository for null checking.
|
||||
|
||||
### Command Palette
|
||||
- #44886: Fixed personalization section not appearing by using latest MSIX for installation.
|
||||
- #44938: Fixed loading of icons from internet shortcuts. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- #45076: Fixed potential deadlock from lazy-loading AppListItem details. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
|
||||
### Cursor Wrap
|
||||
- #44936: Added improved multi-monitor support; Added laptop lid close detection for dynamic monitor topology updates. Thanks [@mikehall-ms](https://github.com/mikehall-ms)!
|
||||
- #44936: Added new settings dropdown to constrain wrapping to horizontal-only, vertical-only, or both directions. Thanks [@mikehall-ms](https://github.com/mikehall-ms)!
|
||||
|
||||
### Peek
|
||||
- #44995: Fixed Space key triggering Peek during file rename, search, or address bar typing.
|
||||
|
||||
### PowerRename
|
||||
- #44944: Fixed regex `$` not working, preventing users from adding text at the end of filenames.
|
||||
|
||||
### Runner
|
||||
- #44931: Monochrome tray icon now adapts to Windows system theme instead of app theme.
|
||||
- #44982: Fixed right-click menu to dynamically update based on Quick Access enabled/disabled state.
|
||||
|
||||
### GPO / Enterprise
|
||||
- #45028: Added CursorWrap policy definition to ADMX templates. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
|
||||
For the full list of v0.97 changes, visit the [Windows Command Line blog](https://aka.ms/powertoys-releaseblog).
|
||||
|
||||
## Advanced Paste
|
||||
|
||||
- Added hex color previews in clipboard history. Thanks [@crramirez](https://github.com/crramirez)!
|
||||
- Added automatic placeholder endpoints when required fields are left empty.
|
||||
- Fixed a grammar issue in the AI settings description. Thanks [@erik-anderson](https://github.com/erik-anderson)!
|
||||
- Fixed loading order so custom action hotkeys are read correctly.
|
||||
- Updated Advanced Paste descriptions to reflect support for online and local models.
|
||||
- Fixed clipboard history item selection so it doesn’t duplicate entries.
|
||||
- Prevented placeholder endpoints from being saved for providers that don’t need them.
|
||||
- Added image input support for AI transforms and improved clipboard change tracking.
|
||||
|
||||
## Awake
|
||||
|
||||
- Fixed Awake CLI so help, errors, and logs appear correctly in the console. Thanks [@daverayment](https://github.com/daverayment)!
|
||||
|
||||
## Command Palette
|
||||
|
||||
- Fixed background image loading in BlurImageControl. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Fixed SDK packaging paths and added a CI SDK build stage.
|
||||
- Aligned naming and spell-checking with .NET conventions. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added drag-and-drop support for Command Palette items. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added a PowerToys Command Palette extension to discover and launch PowerToys utilities.
|
||||
- Fixed grid view bindings and layout issues. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Fixed a line-break issue in RDC extension toast messages. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Made the Settings button text localizable. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Hid the RDC fallback on the home page and fixed MSTSC working directory handling. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Optimized result list merging for better performance. Thanks [@daverayment](https://github.com/daverayment)!
|
||||
- Added Small/Medium/Large detail sizes in the extensions API. Thanks [@DevLGuilherme](https://github.com/DevLGuilherme)!
|
||||
- Hid fallback commands on the home page when no query is entered. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added back navigation support in the Settings window. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added a Command Palette solution filter. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Updated Extension SDK documentation links to Microsoft Learn. Thanks [@RubenFricke](https://github.com/RubenFricke)!
|
||||
- Added a custom search engine URL setting for Web Search. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added pinyin matching for Chinese input. Thanks [@frg2089](https://github.com/frg2089)!
|
||||
- Bumped Command Palette version to 0.8.
|
||||
- Removed subtitles from built-in top-level commands. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Refined separator styling in the details pane. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added a built-in Remote Desktop extension.
|
||||
- Added a Peek command to the Indexer extension.
|
||||
- Improved default browser detection using the Windows Shell API. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added Escape key behavior options. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added theme and background customization options. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Improved WinGet package app matching. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added an auto-return-home delay setting. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added fallback ranking and global results settings.
|
||||
- Removed the selection indicator in the context menu list. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added a developer ribbon with build and log info. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Updated the “Learn more” string for Command Palette. Thanks [@pratnala](https://github.com/pratnala)!
|
||||
- Added arrow-key navigation for grid views. Thanks [@samrueby](https://github.com/samrueby)!
|
||||
- Fixed version display when running unpackaged. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added a native debugging launch profile. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Reduced redundant property change notifications in the SDK. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Improved section readability and accessibility. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Made gallery spacing uniform. Thanks [@jiripolasek](https://github.com/jiripolasek)!
|
||||
- Added sections and separators for list and grid pages. Thanks [@DevLGuilherme](https://github.com/DevLGuilherme)!
|
||||
|
||||
## Crop & Lock
|
||||
|
||||
- Added a screenshot mode that freezes a cropped region into its own window. Thanks [@fm-sys](https://github.com/fm-sys)!
|
||||
|
||||
## Cursor Wrap
|
||||
|
||||
- Improved Cursor Wrap behavior on multi-monitor setups by wrapping only at outer edges. Thanks [@mikehall-ms](https://github.com/mikehall-ms)!
|
||||
|
||||
## FancyZones
|
||||
|
||||
- Fixed editor overlay positioning on mixed-DPI multi-monitor setups. Thanks [@Memphizzz](https://github.com/Memphizzz)!
|
||||
- Added a FancyZones CLI for command-line layout management.
|
||||
|
||||
## File Locksmith
|
||||
|
||||
- Added a File Locksmith CLI for querying, waiting on, or killing file locks.
|
||||
|
||||
## Find My Mouse
|
||||
|
||||
- Improved spotlight edge rendering for clearer Find My Mouse visuals.
|
||||
- Added telemetry to track how Find My Mouse is triggered.
|
||||
|
||||
## Image Resizer
|
||||
|
||||
- Fixed Fill mode cropping when Shrink Only is enabled. Thanks [@daverayment](https://github.com/daverayment)!
|
||||
- Added a dedicated Image Resizer CLI for scripted resizing.
|
||||
|
||||
## Light Switch
|
||||
|
||||
- Added telemetry events for Light Switch usage and settings changes.
|
||||
- Added a Follow Night Light mode to sync theme changes with Night Light.
|
||||
- Clarified LightSwitchService and LightSwitchStateManager roles in docs.
|
||||
- Added a Quick Access dashboard button to toggle Light Switch quickly.
|
||||
- Ensured Light Switch honors GPO policy states with clear status messaging.
|
||||
|
||||
## Mouse Without Borders
|
||||
|
||||
- Continued refactoring Mouse Without Borders by splitting the large Common class into focused components. Thanks [@mikeclayton](https://github.com/mikeclayton)!
|
||||
- Completed the Common class refactor with Core and IPC helper extraction. Thanks [@mikeclayton](https://github.com/mikeclayton)!
|
||||
|
||||
## Peek
|
||||
|
||||
- Hardened Peek previews with strict resource filtering and safer external link warnings.
|
||||
- Improved SVG preview compatibility by rendering via WebView2.
|
||||
|
||||
## PowerRename
|
||||
|
||||
- Added HEIF/AVIF EXIF metadata extraction and extension status guidance for related previews.
|
||||
- Fixed undefined behavior in file time handling. Thanks [@safocl](https://github.com/safocl)!
|
||||
- Optimized memory allocation for depth-based rename processing.
|
||||
- Fixed Unicode normalization and non‑breaking space matching. Thanks [@daverayment](https://github.com/daverayment)!
|
||||
- Fixed date token replacements followed by capital letters. Thanks [@daverayment](https://github.com/daverayment)!
|
||||
|
||||
## PowerToys Run Plugins
|
||||
|
||||
- Fixed a plugin name typo and added Project Launcher to the third‑party list. Thanks [@artickc](https://github.com/artickc)!
|
||||
- Added the Open With Antigravity plugin to the third‑party list. Thanks [@artickc](https://github.com/artickc)!
|
||||
|
||||
## PowerToys Run
|
||||
|
||||
- Avoided unnecessary hotkey conflict checks when settings change.
|
||||
- Added QuickAI to the third-party PowerToys Run plugin list. Thanks [@ruslanlap](https://github.com/ruslanlap)!
|
||||
|
||||
## Quick Accent
|
||||
|
||||
- Added localized quotation marks to Quick Accent. Thanks [@warquys](https://github.com/warquys)!
|
||||
- Fixed duplicate and redundant characters in Quick Accent sets. Thanks [@noraa-junker](https://github.com/noraa-junker)!
|
||||
- Fixed DPI positioning issues for Quick Accent on mixed-DPI setups. Thanks [@noraa-junker](https://github.com/noraa-junker)!
|
||||
|
||||
## Settings
|
||||
|
||||
- Added a new tray icon that adapts to theme changes. Thanks [@HO-COOH](https://github.com/HO-COOH)!
|
||||
- Centralized module enable/disable logic for cleaner Settings UI updates.
|
||||
- Simplified Settings utilities by removing ISettingsUtils/ISettingsPath interfaces. Thanks [@noraa-junker](https://github.com/noraa-junker)!
|
||||
- Improved Settings UI consistency and disabled-state visuals.
|
||||
- Added semantic headings to the Dashboard for better accessibility.
|
||||
- Introduced Quick Access as a standalone host with updated Settings integration.
|
||||
- Fixed Dashboard toggle flicker and sort menu checkmarks. Thanks [@daverayment](https://github.com/daverayment)!
|
||||
- Added Native AOT-compatible settings serialization.
|
||||
- Standardized mouse tool description text. Thanks [@daverayment](https://github.com/daverayment)!
|
||||
- Added a global SettingsUtils singleton to reduce repeated initialization.
|
||||
|
||||
## Development
|
||||
|
||||
- Fixed broken devdocs links to the coding style guide. Thanks [@RubenFricke](https://github.com/RubenFricke)!
|
||||
- Migrated main and installer solutions to .slnx for improved build tooling.
|
||||
- Restored local installer builds after the WiX v5 upgrade with signing and versioning fixes.
|
||||
- Added incremental review tooling and structured AI prompts for PR/issue reviews.
|
||||
- Documented bot commands and cleaned up devdocs structure. Thanks [@noraa-junker](https://github.com/noraa-junker)!
|
||||
- Updated WinAppSDK pipeline defaults to 1.8 and fixed restore handling.
|
||||
- Updated the COMMUNITY list to reflect current roles.
|
||||
- Maintained community member ordering and added a new entry.
|
||||
- Re-enabled centralized PackageReference for native projects with VS auto-restore.
|
||||
- Disabled MSBuild caching by default in CI to avoid build instability.
|
||||
- Updated the latest WinAppSDK daily pipeline for split-dependency restores.
|
||||
- Suppressed experimental build warnings and aligned WrapPanel stretch handling.
|
||||
- Reordered the spell-check expect list for consistent automation.
|
||||
- Migrated native projects to centralized PackageReference management.
|
||||
- Cleaned spell-check dictionary entries and capitalization.
|
||||
- Synced commit/PR prompts and wired VS Code to repo prompt files.
|
||||
- Added VS Code build tasks and improved build script path handling.
|
||||
- Updated Windows App SDK package versions in central package management.
|
||||
- Migrated cmdpal extension native project to PackageReference and fixed outputs.
|
||||
- Reverted PackageReference changes back to packages.config where needed.
|
||||
- Bypassed a release version check for a failing DLL to keep pipelines green.
|
||||
- Consolidated Copilot instructions and fixed prompt frontmatter.
|
||||
- Added signing entries for new Quick Access binaries and CLI version metadata.
|
||||
- Fixed install scope detection to avoid mixed per-user/per-machine installs.
|
||||
- Added a Module Loader tool to quickly test PowerToys modules without full builds. Thanks [@mikehall-ms](https://github.com/mikehall-ms)!
|
||||
- Added update telemetry to understand auto-update checks and downloads.
|
||||
- Updated the telemetry package for new compliance requirements. Thanks [@carlos-zamora](https://github.com/carlos-zamora)!
|
||||
- Documented missing telemetry events in DATA_AND_PRIVACY.
|
||||
- Fixed UI test pipeline restores for .slnx solutions.
|
||||
- Added UI automation coverage for Advanced Paste clipboard history flows.
|
||||
- Stabilized FancyZones UI tests with more reliable selectors and screen recordings.
|
||||
|
||||
## 🛣️ Roadmap
|
||||
We are planning some nice new features and improvements for the next releases – PowerDisplay, Command Palette improvements and a brand-new Shortcut Guide experience! Stay tuned for [v0.98][github-next-release-work]!
|
||||
|
||||
## ❤️ PowerToys Community
|
||||
The PowerToys team is extremely grateful to have the [support of an amazing active community][community-link]. The work you do is incredibly important. PowerToys wouldn't be nearly what it is today without your help filing bugs, updating documentation, guiding the design, or writing features. We want to say thank you and take time to recognize your work. Your contributions and feedback improve PowerToys month after month!
|
||||
|
||||
## Contributing
|
||||
This project welcomes contributions of all types. Besides coding features / bug fixes, other ways to assist include spec writing, design, documentation, and finding bugs. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows. We ask that **before you start work on a feature that you would like to contribute**, please read our [Contributor's Guide](CONTRIBUTING.md). We would be happy to work with you to figure out the best approach, provide guidance and mentorship throughout feature development, and help avoid any wasted or duplicate effort. Most contributions require you to agree to a [Contributor License Agreement (CLA)][oss-CLA] declaring that you grant us the rights to use your contribution and that you have permission to do so. For guidance on developing for PowerToys, please read the [developer docs](./doc/devdocs) for a detailed breakdown. This includes how to setup your computer to compile.
|
||||
## Contributing
|
||||
|
||||
## Code of Conduct
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct][oss-conduct-code].
|
||||
This project welcomes contributions of all types. Besides coding features / bug fixes, other ways to assist include spec writing, design, documentation, and finding bugs. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows. We ask that **before you start work on a feature that you would like to contribute**, please read our [Contributor's Guide](CONTRIBUTING.md). We would be happy to work with you to figure out the best approach, provide guidance and mentorship throughout feature development, and help avoid any wasted or duplicate effort. Most contributions require you to agree to a [Contributor License Agreement (CLA)][oss-CLA] declaring that you grant us the rights to use your contribution and that you have permission to do so. For guidance on developing for PowerToys, please read the [developer docs](./doc/devdocs) for a detailed breakdown. This includes how to setup your computer to compile.
|
||||
|
||||
## Privacy Statement
|
||||
The application logs basic diagnostic data (telemetry). For more privacy information and what we collect, see our [PowerToys Data and Privacy documentation](https://aka.ms/powertoys-data-and-privacy-documentation).
|
||||
## Code of conduct
|
||||
|
||||
[oss-CLA]: https://cla.opensource.microsoft.com
|
||||
[oss-conduct-code]: CODE_OF_CONDUCT.md
|
||||
[community-link]: COMMUNITY.md
|
||||
[github-release-link]: https://aka.ms/installPowerToys
|
||||
[microsoft-store-link]: https://aka.ms/getPowertoys
|
||||
[winget-link]: https://github.com/microsoft/winget-cli#installing-the-client
|
||||
[roadmap]: https://github.com/microsoft/PowerToys/wiki/Roadmap
|
||||
[privacy-link]: http://go.microsoft.com/fwlink/?LinkId=521839
|
||||
[loc-bug]: https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=&template=translation_issue.md&title=
|
||||
[usingPowerToys-docs-link]: https://aka.ms/powertoys-docs
|
||||
This project has adopted the [Microsoft Open Source Code of Conduct][oss-conduct-code].
|
||||
|
||||
## Privacy statement
|
||||
|
||||
The application logs basic diagnostic data (telemetry). For more privacy information and what we collect, see our [PowerToys Data and Privacy documentation](https://aka.ms/powertoys-data-and-privacy-documentation).
|
||||
|
||||
[oss-CLA]: https://cla.opensource.microsoft.com
|
||||
[oss-conduct-code]: CODE_OF_CONDUCT.md
|
||||
[community-link]: COMMUNITY.md
|
||||
|
||||
24
SECURITY.md
24
SECURITY.md
@@ -1,36 +1,36 @@
|
||||
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
|
||||
|
||||
## Security
|
||||
# Security
|
||||
|
||||
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
|
||||
|
||||
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
|
||||
|
||||
## Reporting Security Issues
|
||||
## Reporting security issues
|
||||
|
||||
**Please do not report security vulnerabilities through public GitHub issues.**
|
||||
|
||||
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
|
||||
|
||||
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
|
||||
If you prefer to submit without logging in, send an email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
|
||||
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
|
||||
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
|
||||
|
||||
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
||||
|
||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
* Full paths of source file(s) related to the manifestation of the issue
|
||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
||||
* Any special configuration required to reproduce the issue
|
||||
* Step-by-step instructions to reproduce the issue
|
||||
* Proof-of-concept or exploit code (if possible)
|
||||
* Impact of the issue, including how an attacker might exploit the issue
|
||||
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
||||
- Full paths of source file(s) related to the manifestation of the issue
|
||||
- The location of the affected source code (tag/branch/commit or direct URL)
|
||||
- Any special configuration required to reproduce the issue
|
||||
- Step-by-step instructions to reproduce the issue
|
||||
- Proof-of-concept or exploit code (if possible)
|
||||
- Impact of the issue, including how an attacker might exploit the issue
|
||||
|
||||
This information will help us triage your report more quickly.
|
||||
|
||||
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
|
||||
|
||||
## Preferred Languages
|
||||
## Preferred languages
|
||||
|
||||
We prefer all communications to be in English.
|
||||
|
||||
|
||||
17
SUPPORT.md
17
SUPPORT.md
@@ -1,24 +1,21 @@
|
||||
# Support
|
||||
|
||||
## How to use Microsoft PowerToys
|
||||
|
||||
## How to use Microsoft PowerToys
|
||||
|
||||
For more info on [PowerToys overviews and how to use the utilities][usingPowerToys-docs-link], or any other tools and resources for [Windows development environments](https://learn.microsoft.com/windows/dev-environment/overview), head over to [learn.microsoft.com][usingPowerToys-docs-link]!
|
||||
For more information about PowerToys overviews, how to use the utilities, and other tools and resources for [Windows development environments](https://learn.microsoft.com/windows/dev-environment/overview), visit [learn.microsoft.com][usingPowerToys-docs-link].
|
||||
|
||||
## How to file issues and get help
|
||||
|
||||
This project uses [GitHub Issues][gh-issue] to [track bugs][gh-bug] and [feature requests][gh-feature]. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or
|
||||
feature request as a new Issue.
|
||||
This project uses [GitHub Issues][gh-issue] to [track bugs][gh-bug] and [feature requests][gh-feature]. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.
|
||||
|
||||
For help and questions about using this project, please look at our Wiki for using PowerToys and our [Contributor's Guide][contributor] if you want to work on PowerToys.
|
||||
For help and questions about using this project, please visit our documentation and [Contributor's Guide][contributor] if you want to contribute to PowerToys.
|
||||
|
||||
## Microsoft Support Policy
|
||||
## Microsoft support policy
|
||||
|
||||
Support for PowerToys is limited to the resources listed above.
|
||||
|
||||
[gh-issue]: https://github.com/microsoft/PowerToys/issues/new/choose
|
||||
[gh-bug]: https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=Issue-Bug&template=bug_report.md&title=
|
||||
[gh-feature]: https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=&template=feature_request.md&title=
|
||||
[wiki]: https://github.com/microsoft/PowerToys/wiki
|
||||
[gh-bug]: https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=Issue-Bug&template=bug_report.md
|
||||
[gh-feature]: https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=&template=feature_request.md
|
||||
[contributor]: https://github.com/microsoft/PowerToys/blob/main/CONTRIBUTING.md
|
||||
[usingPowerToys-docs-link]: https://aka.ms/powertoys-docs
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
# Settings resource
|
||||
Manage the settings for PowerToys modules
|
||||
|
||||
## Commands
|
||||
|
||||
### ✨ Modules
|
||||
List all the modules supported by the settings resource.
|
||||
```shell
|
||||
PS C:\> PowerToys.DSC.exe modules --resource 'settings'
|
||||
AdvancedPaste
|
||||
AlwaysOnTop
|
||||
App
|
||||
Awake
|
||||
ColorPicker
|
||||
CropAndLock
|
||||
EnvironmentVariables
|
||||
FancyZones
|
||||
FileLocksmith
|
||||
FindMyMouse
|
||||
Hosts
|
||||
ImageResizer
|
||||
KeyboardManager
|
||||
MeasureTool
|
||||
MouseHighlighter
|
||||
MouseJump
|
||||
MousePointerCrosshairs
|
||||
Peek
|
||||
PowerAccent
|
||||
PowerOCR
|
||||
PowerRename
|
||||
RegistryPreview
|
||||
ShortcutGuide
|
||||
Workspaces
|
||||
ZoomIt
|
||||
```
|
||||
|
||||
### 📄 Get
|
||||
Get the settings for a specific module.
|
||||
```shell
|
||||
PS C:\> PowerToys.DSC.exe get --resource 'settings' --module EnvironmentVariables
|
||||
{"settings":{"properties":{"LaunchAdministrator":{"value":true}},"name":"EnvironmentVariables","version":"1.0"}}
|
||||
```
|
||||
|
||||
### 🖨️ Export
|
||||
Export the settings for a specific module.
|
||||
|
||||
ℹ️ Settings resource Get and Export operation output states are identical.
|
||||
```shell
|
||||
PS C:\> PowerToys.DSC.exe get --resource 'settings' --module EnvironmentVariables
|
||||
{"settings":{"properties":{"LaunchAdministrator":{"value":true}},"name":"EnvironmentVariables","version":"1.0"}}
|
||||
```
|
||||
|
||||
### 📝 Set
|
||||
Set the settings for a specific module. This command will update the settings to the specified values.
|
||||
```shell
|
||||
PS C:\> PowerToys.DSC.exe set --resource 'settings' --module Awake --input '{"settings":{"properties":{"keepDisplayOn":false,"mode":0,"intervalHours":0,"intervalMinutes":1,"expirationDateTime":"2025-08-13T10:10:00.000001-07:00","customTrayTimes":{}},"name":"Awake","version":"0.0.1"}}'
|
||||
{"settings":{"properties":{"keepDisplayOn":false,"mode":0,"intervalHours":0,"intervalMinutes":1,"expirationDateTime":"2025-08-13T10:10:00.000001-07:00","customTrayTimes":{}},"name":"Awake","version":"0.0.1"}}
|
||||
["settings"]
|
||||
```
|
||||
|
||||
### 🧪 Test
|
||||
Test the settings for a specific module. This command will check if the current settings match the desired state.
|
||||
```shell
|
||||
PS C:\> PowerToys.DSC.exe test --resource 'settings' --module Awake --input '{"settings":{"properties":{"keepDisplayOn":false,"mode":0,"intervalHours":0,"intervalMinutes":1,"expirationDateTime":"2025-08-13T10:10:00.000002-07:00","customTrayTimes":{}},"name":"Awake","version":"0.0.1"}}'
|
||||
{"settings":{"properties":{"keepDisplayOn":false,"mode":0,"intervalHours":0,"intervalMinutes":1,"expirationDateTime":"2025-08-13T10:10:00.000001-07:00","customTrayTimes":{}},"name":"Awake","version":"0.0.1"},"_inDesiredState":false}
|
||||
["settings"]
|
||||
```
|
||||
|
||||
### 🛠️ Schema
|
||||
Generates the JSON schema for the settings resource of a specific module.
|
||||
```shell
|
||||
PS C:\> PowerToys.DSC.exe schema --resource 'settings' --module Awake
|
||||
{"$schema":"http://json-schema.org/draft-04/schema#","title":"SettingsResourceObjectOfAwakeSettings","type":"object","additionalProperties":false,"required":["settings"],"properties":{"_inDesiredState":{"type":["boolean","null"],"description":"Indicates whether an instance is in the desired state"},"settings":{"description":"The settings content for the module."}}}
|
||||
PS E:\src\powertoys> PowerToys.DSC.exe schema --resource 'settings' --module Awake | Format-Json
|
||||
```
|
||||
|
||||
### 📦 Manifest
|
||||
Generates a manifest dsc resource JSON file for the specified module.
|
||||
- If the module is not specified, it will generate a manifest for all modules.
|
||||
- If the output directory is not specified, it will print the manifest to the console.
|
||||
```shell
|
||||
PS C:\> PowerToys.DSC.exe manifest --resource settings --module 'Awake' --outputDir "C:\manifests"
|
||||
```
|
||||
263
doc/dsc/modules/AdvancedPaste.md
Normal file
263
doc/dsc/modules/AdvancedPaste.md
Normal file
@@ -0,0 +1,263 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys AdvancedPaste module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: AdvancedPaste Module
|
||||
---
|
||||
|
||||
# AdvancedPaste Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Advanced Paste utility, which provides advanced clipboard operations and custom paste formats.
|
||||
|
||||
## Description
|
||||
|
||||
The `AdvancedPaste` module configures PowerToys Advanced Paste, a utility
|
||||
that extends clipboard functionality with AI-powered transformations, custom
|
||||
formats, and advanced paste options. It allows you to paste clipboard content
|
||||
with transformations like plain text conversion, markdown formatting, JSON
|
||||
formatting, and AI-based text processing.
|
||||
|
||||
## Properties
|
||||
|
||||
The AdvancedPaste module supports the following configurable properties:
|
||||
|
||||
### IsAdvancedAIEnabled
|
||||
|
||||
Controls whether AI-powered paste transformations are enabled.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
**Description:** Enables AI-based clipboard transformations such as
|
||||
summarization, translation, and content reformatting.
|
||||
|
||||
### PasteAsPlainTextHotkey
|
||||
|
||||
Sets the keyboard shortcut for pasting as plain text.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier.
|
||||
- `ctrl` (boolean) - Ctrl key modifier.
|
||||
- `alt` (boolean) - Alt key modifier.
|
||||
- `shift` (boolean) - Shift key modifier.
|
||||
- `code` (integer) - Virtual key code.
|
||||
- `key` (string) - Key name.
|
||||
|
||||
**Default:** `Ctrl+Win+V`
|
||||
|
||||
### PasteAsMarkdownHotkey
|
||||
|
||||
Sets the keyboard shortcut for pasting as markdown.
|
||||
|
||||
**Type:** object (same structure as PasteAsPlainTextHotkey)
|
||||
**Default:** `Ctrl+Win+Shift+V`
|
||||
|
||||
### PasteAsJsonHotkey
|
||||
|
||||
Sets the keyboard shortcut for pasting as JSON.
|
||||
|
||||
**Type:** object (same structure as PasteAsPlainTextHotkey)
|
||||
|
||||
### ShowCustomPreview
|
||||
|
||||
Controls whether a preview window is shown before pasting custom formats.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### CloseAfterLosingFocus
|
||||
|
||||
Controls whether the Advanced Paste window closes when it loses focus.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Enable AI features with direct execution
|
||||
|
||||
This example enables AI-powered paste transformations.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
IsAdvancedAIEnabled = $true
|
||||
}
|
||||
name = "AdvancedPaste"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module AdvancedPaste `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure paste hotkeys with DSC
|
||||
|
||||
This example customizes keyboard shortcuts for different paste formats.
|
||||
|
||||
```bash
|
||||
dsc config set --file advancedpaste-hotkeys.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# advancedpaste-hotkeys.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Advanced Paste hotkeys
|
||||
type: Microsoft.PowerToys/AdvancedPasteSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PasteAsPlainTextHotkey:
|
||||
win: true
|
||||
ctrl: true
|
||||
alt: false
|
||||
shift: false
|
||||
code: 86
|
||||
key: V
|
||||
PasteAsMarkdownHotkey:
|
||||
win: true
|
||||
ctrl: true
|
||||
alt: false
|
||||
shift: true
|
||||
code: 86
|
||||
key: V
|
||||
name: AdvancedPaste
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Advanced Paste with AI
|
||||
enabled.
|
||||
|
||||
```bash
|
||||
winget configure winget-advancedpaste.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-advancedpaste.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Advanced Paste
|
||||
type: Microsoft.PowerToys/AdvancedPasteSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
IsAdvancedAIEnabled: true
|
||||
ShowCustomPreview: true
|
||||
CloseAfterLosingFocus: true
|
||||
name: AdvancedPaste
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Enable with custom preview settings
|
||||
|
||||
This example configures preview behavior for custom paste formats.
|
||||
|
||||
```bash
|
||||
dsc config set --file advancedpaste-preview.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# advancedpaste-preview.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure preview settings
|
||||
type: Microsoft.PowerToys/AdvancedPasteSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ShowCustomPreview: true
|
||||
CloseAfterLosingFocus: false
|
||||
name: AdvancedPaste
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Test AI enablement
|
||||
|
||||
This example tests whether AI features are enabled.
|
||||
|
||||
```powershell
|
||||
$desired = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
IsAdvancedAIEnabled = $true
|
||||
}
|
||||
name = "AdvancedPaste"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
$result = PowerToys.DSC.exe test --resource 'settings' `
|
||||
--module AdvancedPaste --input $desired | ConvertFrom-Json
|
||||
|
||||
if ($result._inDesiredState) {
|
||||
Write-Host "AI features are enabled"
|
||||
} else {
|
||||
Write-Host "AI features need to be enabled"
|
||||
}
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Development workflow
|
||||
|
||||
Enable AI transformations for code snippets and documentation:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Developer paste settings
|
||||
type: Microsoft.PowerToys/AdvancedPasteSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
IsAdvancedAIEnabled: true
|
||||
ShowCustomPreview: true
|
||||
name: AdvancedPaste
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Content creation
|
||||
|
||||
Configure for markdown and formatted text operations:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Content creator settings
|
||||
type: Microsoft.PowerToys/AdvancedPasteSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ShowCustomPreview: true
|
||||
CloseAfterLosingFocus: false
|
||||
name: AdvancedPaste
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [ColorPicker Module][03] - System-wide color picker utility
|
||||
- [PowerToys Advanced Paste Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./ColorPicker.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/advanced-paste
|
||||
299
doc/dsc/modules/AlwaysOnTop.md
Normal file
299
doc/dsc/modules/AlwaysOnTop.md
Normal file
@@ -0,0 +1,299 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys AlwaysOnTop module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: AlwaysOnTop Module
|
||||
---
|
||||
|
||||
# AlwaysOnTop Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Always On Top utility, which pins windows to stay on top of other windows.
|
||||
|
||||
## Description
|
||||
|
||||
The `AlwaysOnTop` module configures PowerToys Always On Top, a utility that
|
||||
allows you to pin any window to remain visible above all other windows. This
|
||||
is useful for keeping reference materials, chat windows, or monitoring tools
|
||||
visible while working with other applications.
|
||||
|
||||
## Properties
|
||||
|
||||
The AlwaysOnTop module supports the following configurable properties:
|
||||
|
||||
### Hotkey
|
||||
|
||||
Sets the keyboard shortcut to toggle Always On Top for the active window.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier.
|
||||
- `ctrl` (boolean) - Ctrl key modifier.
|
||||
- `alt` (boolean) - Alt key modifier.
|
||||
- `shift` (boolean) - Shift key modifier.
|
||||
- `code` (integer) - Virtual key code.
|
||||
- `key` (string) - Key name.
|
||||
|
||||
**Default:** `Win+Ctrl+T`
|
||||
|
||||
### FrameEnabled
|
||||
|
||||
Controls whether a colored border is displayed around pinned windows.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### FrameThickness
|
||||
|
||||
Sets the thickness of the border around pinned windows (in pixels).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `1` to `100`
|
||||
**Default:** `5`
|
||||
|
||||
### FrameColor
|
||||
|
||||
Sets the color of the border around pinned windows.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Default:** `"#FF0000"` (red)
|
||||
|
||||
### FrameOpacity
|
||||
|
||||
Sets the opacity of the border (0-100).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `100`
|
||||
**Default:** `100`
|
||||
|
||||
### FrameAccentColor
|
||||
|
||||
Controls whether to use the Windows accent color for the frame.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### SoundEnabled
|
||||
|
||||
Controls whether a sound plays when toggling Always On Top.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### DoNotActivateOnGameMode
|
||||
|
||||
Controls whether Always On Top is automatically disabled during game mode.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### RoundCornersEnabled
|
||||
|
||||
Controls whether the frame has rounded corners.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### ExcludedApps
|
||||
|
||||
List of applications excluded from Always On Top functionality.
|
||||
|
||||
**Type:** string (newline-separated list of executable names)
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Enable with default settings using direct execution
|
||||
|
||||
This example enables Always On Top with default border appearance.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
FrameEnabled = $true
|
||||
FrameThickness = 5
|
||||
FrameColor = "#FF0000"
|
||||
FrameOpacity = 100
|
||||
}
|
||||
name = "AlwaysOnTop"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module AlwaysOnTop `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Customize frame appearance with DSC
|
||||
|
||||
This example configures a custom border color and thickness.
|
||||
|
||||
```bash
|
||||
dsc config set --file alwaysontop-appearance.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# alwaysontop-appearance.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Customize Always On Top frame
|
||||
type: Microsoft.PowerToys/AlwaysOnTopSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
FrameEnabled: true
|
||||
FrameThickness: 8
|
||||
FrameColor: "#0078D7"
|
||||
FrameOpacity: 80
|
||||
RoundCornersEnabled: true
|
||||
name: AlwaysOnTop
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Configure with accent color using WinGet
|
||||
|
||||
This example installs PowerToys and configures Always On Top to use the
|
||||
Windows accent color.
|
||||
|
||||
```bash
|
||||
winget configure winget-alwaysontop.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-alwaysontop.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Always On Top
|
||||
type: Microsoft.PowerToys/AlwaysOnTopSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
FrameEnabled: true
|
||||
FrameAccentColor: true
|
||||
FrameThickness: 6
|
||||
SoundEnabled: true
|
||||
name: AlwaysOnTop
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Disable for gaming
|
||||
|
||||
This example ensures Always On Top is disabled during game mode.
|
||||
|
||||
```yaml
|
||||
# alwaysontop-gaming.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure for gaming
|
||||
type: Microsoft.PowerToys/AlwaysOnTopSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
DoNotActivateOnGameMode: true
|
||||
name: AlwaysOnTop
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Minimal border configuration
|
||||
|
||||
This example configures a subtle, thin border.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
FrameEnabled = $true
|
||||
FrameThickness = 2
|
||||
FrameOpacity = 50
|
||||
RoundCornersEnabled = true
|
||||
}
|
||||
name = "AlwaysOnTop"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module AlwaysOnTop --input $config
|
||||
```
|
||||
|
||||
### Example 6 - Exclude specific applications
|
||||
|
||||
This example excludes certain applications from Always On Top.
|
||||
|
||||
```yaml
|
||||
# alwaysontop-exclusions.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Exclude apps from Always On Top
|
||||
type: Microsoft.PowerToys/AlwaysOnTopSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExcludedApps: |
|
||||
Game.exe
|
||||
FullScreenApp.exe
|
||||
name: AlwaysOnTop
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Reference material
|
||||
|
||||
Keep documentation or reference windows visible:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Reference window settings
|
||||
type: Microsoft.PowerToys/AlwaysOnTopSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
FrameEnabled: true
|
||||
FrameColor: "#00FF00"
|
||||
FrameOpacity: 60
|
||||
name: AlwaysOnTop
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Monitoring dashboards
|
||||
|
||||
Pin monitoring tools and dashboards:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Monitoring settings
|
||||
type: Microsoft.PowerToys/AlwaysOnTopSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
FrameEnabled: true
|
||||
FrameAccentColor: true
|
||||
SoundEnabled: false
|
||||
name: AlwaysOnTop
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [FancyZones Module][03] - Window layout manager
|
||||
- [PowerToys Always On Top Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./FancyZones.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/always-on-top
|
||||
279
doc/dsc/modules/App.md
Normal file
279
doc/dsc/modules/App.md
Normal file
@@ -0,0 +1,279 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys App module (general settings)
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: App module
|
||||
---
|
||||
|
||||
# App Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages general PowerToys application settings, including utility enable/disable states, startup behavior, and theme preferences.
|
||||
|
||||
## Description
|
||||
|
||||
The `App` module controls global PowerToys settings that affect the entire
|
||||
application. This includes which utilities are enabled, whether PowerToys
|
||||
runs at startup, the application theme, and other general preferences.
|
||||
|
||||
Unlike other modules that configure specific utilities, the App module
|
||||
manages PowerToys-wide settings and the enabled state of all utilities.
|
||||
|
||||
## Properties
|
||||
|
||||
The App module supports the following configurable properties:
|
||||
|
||||
### Enabled
|
||||
|
||||
Controls which PowerToys utilities are enabled or disabled.
|
||||
|
||||
**Type:** Object
|
||||
**Properties:**
|
||||
|
||||
- `AdvancedPaste` (boolean) - Enable/disable Advanced Paste utility.
|
||||
- `AlwaysOnTop` (boolean) - Enable/disable Always On Top utility.
|
||||
- `Awake` (boolean) - Enable/disable Awake utility.
|
||||
- `ColorPicker` (boolean) - Enable/disable Color Picker utility.
|
||||
- `CropAndLock` (boolean) - Enable/disable Crop And Lock utility.
|
||||
- `EnvironmentVariables` (boolean) - Enable/disable Environment Variables
|
||||
utility.
|
||||
- `FancyZones` (boolean) - Enable/disable FancyZones utility.
|
||||
- `FileLocksmith` (boolean) - Enable/disable File Locksmith utility.
|
||||
- `FindMyMouse` (boolean) - Enable/disable Find My Mouse utility.
|
||||
- `Hosts` (boolean) - Enable/disable Hosts File Editor utility.
|
||||
- `ImageResizer` (boolean) - Enable/disable Image Resizer utility.
|
||||
- `KeyboardManager` (boolean) - Enable/disable Keyboard Manager utility.
|
||||
- `MeasureTool` (boolean) - Enable/disable Measure Tool utility.
|
||||
- `MouseHighlighter` (boolean) - Enable/disable Mouse Highlighter utility.
|
||||
- `MouseJump` (boolean) - Enable/disable Mouse Jump utility.
|
||||
- `MousePointerCrosshairs` (boolean) - Enable/disable Mouse Pointer
|
||||
Crosshairs utility.
|
||||
- `Peek` (boolean) - Enable/disable Peek utility.
|
||||
- `PowerAccent` (boolean) - Enable/disable Power Accent utility.
|
||||
- `PowerOCR` (boolean) - Enable/disable Power OCR utility.
|
||||
- `PowerRename` (boolean) - Enable/disable Power Rename utility.
|
||||
- `RegistryPreview` (boolean) - Enable/disable Registry Preview utility.
|
||||
- `ShortcutGuide` (boolean) - Enable/disable Shortcut Guide utility.
|
||||
- `Workspaces` (boolean) - Enable/disable Workspaces utility.
|
||||
- `ZoomIt` (boolean) - Enable/disable ZoomIt utility.
|
||||
|
||||
### startup
|
||||
|
||||
Controls whether PowerToys starts automatically when you sign in.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### run_elevated
|
||||
|
||||
Controls whether PowerToys runs with administrator privileges.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### theme
|
||||
|
||||
Sets the application theme.
|
||||
|
||||
**Type:** string
|
||||
**Allowed values:** `"light"`, `"dark"`, `"system"`
|
||||
**Default:** `"system"`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Enable specific utilities with direct execution
|
||||
|
||||
This example enables only FancyZones, PowerRename, and ColorPicker while
|
||||
disabling all others.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
Enabled = @{
|
||||
AdvancedPaste = $false
|
||||
AlwaysOnTop = $false
|
||||
Awake = $false
|
||||
ColorPicker = $true
|
||||
CropAndLock = $false
|
||||
EnvironmentVariables = $false
|
||||
FancyZones = $true
|
||||
FileLocksmith = $false
|
||||
FindMyMouse = $false
|
||||
Hosts = $false
|
||||
ImageResizer = $false
|
||||
KeyboardManager = $false
|
||||
MeasureTool = $false
|
||||
MouseHighlighter = $false
|
||||
MouseJump = $false
|
||||
MousePointerCrosshairs = $false
|
||||
Peek = $false
|
||||
PowerAccent = $false
|
||||
PowerOCR = $false
|
||||
PowerRename = $true
|
||||
RegistryPreview = $false
|
||||
ShortcutGuide = $false
|
||||
Workspaces = $false
|
||||
ZoomIt = $false
|
||||
}
|
||||
}
|
||||
name = "App"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module App --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure startup and theme with DSC
|
||||
|
||||
This example configures PowerToys to run at startup with elevated privileges
|
||||
and use dark theme.
|
||||
|
||||
```bash
|
||||
dsc config set --file app-config.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# app-config.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure PowerToys general settings
|
||||
type: Microsoft.PowerToys/AppSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
startup: true
|
||||
run_elevated: true
|
||||
theme: dark
|
||||
name: App
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Enable all utilities with WinGet
|
||||
|
||||
This example installs PowerToys and enables all available utilities.
|
||||
|
||||
```bash
|
||||
winget configure winget-enable-all.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-enable-all.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Enable all utilities
|
||||
type: Microsoft.PowerToys/AppSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
Enabled:
|
||||
AdvancedPaste: true
|
||||
AlwaysOnTop: true
|
||||
Awake: true
|
||||
ColorPicker: true
|
||||
CropAndLock: true
|
||||
EnvironmentVariables: true
|
||||
FancyZones: true
|
||||
FileLocksmith: true
|
||||
FindMyMouse: true
|
||||
Hosts: true
|
||||
ImageResizer: true
|
||||
KeyboardManager: true
|
||||
MeasureTool: true
|
||||
MouseHighlighter: true
|
||||
MouseJump: true
|
||||
MousePointerCrosshairs: true
|
||||
Peek: true
|
||||
PowerAccent: true
|
||||
PowerOCR: true
|
||||
PowerRename: true
|
||||
RegistryPreview: true
|
||||
ShortcutGuide: true
|
||||
Workspaces: true
|
||||
ZoomIt: true
|
||||
name: App
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Test if specific utilities are enabled
|
||||
|
||||
This example tests whether FancyZones and PowerRename are enabled.
|
||||
|
||||
```powershell
|
||||
$desired = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
Enabled = @{
|
||||
FancyZones = $true
|
||||
PowerRename = $true
|
||||
}
|
||||
}
|
||||
name = "App"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
$result = PowerToys.DSC.exe test --resource 'settings' --module App `
|
||||
--input $desired | ConvertFrom-Json
|
||||
|
||||
if ($result._inDesiredState) {
|
||||
Write-Host "FancyZones and PowerRename are enabled"
|
||||
} else {
|
||||
Write-Host "Configuration needs to be updated"
|
||||
}
|
||||
```
|
||||
|
||||
### Example 5 - Individual resource for each utility
|
||||
|
||||
This example shows enabling utilities individually, which provides better granularity for complex configurations.
|
||||
|
||||
```powershell
|
||||
# Get current state
|
||||
PowerToys.DSC.exe get --resource 'settings' --module App
|
||||
|
||||
# Enable individual utilities
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
Enabled = @{
|
||||
FancyZones = $true
|
||||
}
|
||||
}
|
||||
name = "App"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module App --input $config
|
||||
```
|
||||
|
||||
### Example 6 - Get schema for App module
|
||||
|
||||
This example retrieves the complete JSON schema for the App module.
|
||||
|
||||
```powershell
|
||||
PowerToys.DSC.exe schema --resource 'settings' --module App | `
|
||||
ConvertFrom-Json | ConvertTo-Json -Depth 10
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [Awake][03]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./Awake.md
|
||||
342
doc/dsc/modules/Awake.md
Normal file
342
doc/dsc/modules/Awake.md
Normal file
@@ -0,0 +1,342 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys Awake module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: Awake Module
|
||||
---
|
||||
|
||||
# Awake Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Awake utility, which keeps your computer awake without changing power settings.
|
||||
|
||||
## Description
|
||||
|
||||
The `Awake` module configures PowerToys Awake, a utility that prevents your
|
||||
computer from going to sleep or turning off the display. This is useful
|
||||
during installations, presentations, or any scenario where you need to
|
||||
temporarily override power settings without permanently changing them.
|
||||
|
||||
Awake supports multiple modes including indefinite keep-awake, timed
|
||||
intervals, and scheduled expiration. The display can be kept on or allowed
|
||||
to turn off independently of the system sleep state.
|
||||
|
||||
## Properties
|
||||
|
||||
The Awake module supports the following configurable properties:
|
||||
|
||||
### keepDisplayOn
|
||||
|
||||
Controls whether the display remains on while Awake is active.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
**Description:** When `true`, prevents the display from turning off. When
|
||||
`false`, only prevents system sleep while allowing the display to turn off
|
||||
according to power settings.
|
||||
|
||||
### mode
|
||||
|
||||
Specifies the Awake operating mode.
|
||||
|
||||
**Type:** integer
|
||||
**Allowed values:**
|
||||
|
||||
- `0` - Off (Awake is disabled).
|
||||
- `1` - Keep awake indefinitely.
|
||||
- `2` - Keep awake for a timed interval.
|
||||
- `3` - Keep awake until a specific date/time.
|
||||
|
||||
**Default:** `0`
|
||||
|
||||
### intervalHours
|
||||
|
||||
Number of hours to keep the system awake (used when mode is `2`).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `999`
|
||||
**Default:** `0`
|
||||
|
||||
### intervalMinutes
|
||||
|
||||
Number of minutes to keep the system awake (used when mode is `2`).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `59`
|
||||
**Default:** `1`
|
||||
|
||||
### expirationDateTime
|
||||
|
||||
The date and time when Awake should automatically disable (used when mode is `3`).
|
||||
|
||||
**Type:** string (ISO 8601 datetime format)
|
||||
**Format:** `"YYYY-MM-DDTHH:mm:ss.fffffffzzz"`
|
||||
**Example:** `"2025-12-31T23:59:59.0000000-08:00"`
|
||||
|
||||
### customTrayTimes
|
||||
|
||||
Custom time intervals displayed in the system tray context menu for quick activation.
|
||||
|
||||
**Type:** object
|
||||
**Description:** A dictionary of custom time presets for quick access. Keys
|
||||
are display names, values are time specifications.
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Keep awake indefinitely with display on
|
||||
|
||||
This example configures Awake to keep the system and display awake
|
||||
indefinitely using direct execution.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
keepDisplayOn = $true
|
||||
mode = 1
|
||||
}
|
||||
name = "Awake"
|
||||
version = "0.0.1"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Awake --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Keep awake for 2 hours with DSC
|
||||
|
||||
This example configures a timed keep-awake period.
|
||||
|
||||
```bash
|
||||
dsc config set --file awake-timed.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# awake-timed.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Awake for 2 hours
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
keepDisplayOn: true
|
||||
mode: 2
|
||||
intervalHours: 2
|
||||
intervalMinutes: 0
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
### Example 3 - Keep awake until specific time with WinGet
|
||||
|
||||
This example configures Awake to stay active until a specific date and time.
|
||||
|
||||
```bash
|
||||
winget configure winget-awake-scheduled.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-awake-scheduled.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Keep awake until end of workday
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
keepDisplayOn: true
|
||||
mode: 3
|
||||
expirationDateTime: "2025-10-18T17:00:00.0000000-07:00"
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
### Example 4 - Disable Awake
|
||||
|
||||
This example disables Awake using direct execution.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
mode = 0
|
||||
}
|
||||
name = "Awake"
|
||||
version = "0.0.1"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Awake --input $config
|
||||
```
|
||||
|
||||
### Example 5 - Keep system awake but allow display to sleep
|
||||
|
||||
This example keeps the system awake while allowing the display to turn off.
|
||||
|
||||
```bash
|
||||
dsc config set --file awake-system-only.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# awake-system-only.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Keep system awake only
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
keepDisplayOn: false
|
||||
mode: 1
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
### Example 6 - Configure for presentation (4 hours)
|
||||
|
||||
This example configures Awake for a presentation scenario using WinGet.
|
||||
|
||||
```bash
|
||||
winget configure presentation-mode.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# presentation-mode.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Enable Awake for presentation
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
keepDisplayOn: true
|
||||
mode: 2
|
||||
intervalHours: 4
|
||||
intervalMinutes: 0
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
### Example 7 - Test current configuration
|
||||
|
||||
This example tests whether Awake is configured for indefinite keep-awake.
|
||||
|
||||
```powershell
|
||||
$desired = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
keepDisplayOn = $true
|
||||
mode = 1
|
||||
}
|
||||
name = "Awake"
|
||||
version = "0.0.1"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
$result = PowerToys.DSC.exe test --resource 'settings' --module Awake --input $desired | ConvertFrom-Json
|
||||
|
||||
if ($result._inDesiredState) {
|
||||
Write-Host "Awake is configured for indefinite keep-awake"
|
||||
} else {
|
||||
Write-Host "Awake configuration differs from desired state"
|
||||
}
|
||||
```
|
||||
|
||||
### Example 8 - Get current Awake configuration
|
||||
|
||||
This example retrieves the current Awake settings.
|
||||
|
||||
```powershell
|
||||
PowerToys.DSC.exe get --resource 'settings' --module Awake | ConvertFrom-Json | ConvertTo-Json -Depth 10
|
||||
```
|
||||
|
||||
### Example 9 - Get Awake schema
|
||||
|
||||
This example retrieves the JSON schema for Awake module properties.
|
||||
|
||||
```powershell
|
||||
PowerToys.DSC.exe schema --resource 'settings' --module Awake | ConvertFrom-Json | ConvertTo-Json -Depth 10
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Development and builds
|
||||
|
||||
Keep the system awake during long-running builds or installations:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Keep awake during build
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
mode: 2
|
||||
intervalHours: 8
|
||||
intervalMinutes: 0
|
||||
keepDisplayOn: false
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
### Presentations and demos
|
||||
|
||||
Ensure the system stays awake during presentations:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Presentation mode
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
mode: 1
|
||||
keepDisplayOn: true
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
### Scheduled maintenance
|
||||
|
||||
Keep the system awake until a specific time for scheduled tasks:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Maintenance window
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
mode: 3
|
||||
expirationDateTime: "2025-10-19T02:00:00.0000000-07:00"
|
||||
keepDisplayOn: false
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [PowerRename][03]
|
||||
- [PowerToys Awake Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./PowerRename.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/awake
|
||||
307
doc/dsc/modules/ColorPicker.md
Normal file
307
doc/dsc/modules/ColorPicker.md
Normal file
@@ -0,0 +1,307 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys ColorPicker module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: ColorPicker Module
|
||||
---
|
||||
|
||||
# ColorPicker Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Color Picker utility, a system-wide color selection and identification tool.
|
||||
|
||||
## Description
|
||||
|
||||
The `ColorPicker` module configures PowerToys Color Picker, a utility that allows you to pick colors from anywhere on your screen and copy them to the clipboard in various formats. It's useful for designers, developers, and anyone working with colors.
|
||||
|
||||
## Properties
|
||||
|
||||
The ColorPicker module supports the following configurable properties:
|
||||
|
||||
### ActivationShortcut
|
||||
|
||||
Sets the keyboard shortcut to activate the color picker.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier.
|
||||
- `ctrl` (boolean) - Ctrl key modifier.
|
||||
- `alt` (boolean) - Alt key modifier.
|
||||
- `shift` (boolean) - Shift key modifier.
|
||||
- `code` (integer) - Virtual key code.
|
||||
- `key` (string) - Key name.
|
||||
|
||||
**Default:** `Win+Shift+C`
|
||||
|
||||
### changecursor
|
||||
|
||||
Controls whether the cursor changes when the color picker is activated.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### copiedcolorrepresentation
|
||||
|
||||
Sets the default color format copied to the clipboard.
|
||||
|
||||
**Type:** string
|
||||
**Allowed values:** `"HEX"`, `"RGB"`, `"HSL"`, `"HSV"`, `"CMYK"`, `"HSB"`,
|
||||
`"HSI"`, `"HWB"`, `"NCol"`
|
||||
**Default:** `"HEX"`
|
||||
|
||||
### activationaction
|
||||
|
||||
Controls the action when the color picker activation shortcut is pressed.
|
||||
|
||||
**Type:** integer
|
||||
**Allowed values:**
|
||||
|
||||
- `0` - Open color picker and show editor
|
||||
- `1` - Open color picker only
|
||||
- `2` - Open editor only
|
||||
|
||||
**Default:** `0`
|
||||
|
||||
### showColorName
|
||||
|
||||
Controls whether color names are displayed in the color picker.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### VisibleColorFormats
|
||||
|
||||
Defines which color formats are visible in the picker interface.
|
||||
|
||||
**Type:** object with boolean properties for each format:
|
||||
|
||||
- `HEX` (boolean)
|
||||
- `RGB` (boolean)
|
||||
- `HSL` (boolean)
|
||||
- `HSV` (boolean)
|
||||
- `CMYK` (boolean)
|
||||
- `HSB` (boolean)
|
||||
- `HSI` (boolean)
|
||||
- `HWB` (boolean)
|
||||
- `NCol` (boolean)
|
||||
- `Decimal` (boolean)
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure default color format with direct execution
|
||||
|
||||
This example sets the default copied color format to RGB.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
copiedcolorrepresentation = "RGB"
|
||||
}
|
||||
name = "ColorPicker"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module ColorPicker --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure activation behavior with DSC
|
||||
|
||||
This example configures the color picker to open directly without the
|
||||
editor.
|
||||
|
||||
```bash
|
||||
dsc config set --file colorpicker-activation.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# colorpicker-activation.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Color Picker activation
|
||||
type: Microsoft.PowerToys/ColorPickerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
activationaction: 1
|
||||
changecursor: true
|
||||
copiedcolorrepresentation: HEX
|
||||
name: ColorPicker
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure for web development with WinGet
|
||||
|
||||
This example installs PowerToys and configures Color Picker for web
|
||||
developers.
|
||||
|
||||
```bash
|
||||
winget configure winget-colorpicker-webdev.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-colorpicker-webdev.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Color Picker for web development
|
||||
type: Microsoft.PowerToys/ColorPickerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
copiedcolorrepresentation: HEX
|
||||
showColorName: true
|
||||
changecursor: true
|
||||
VisibleColorFormats:
|
||||
HEX: true
|
||||
RGB: true
|
||||
HSL: true
|
||||
HSV: false
|
||||
CMYK: false
|
||||
name: ColorPicker
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Configure visible formats
|
||||
|
||||
This example enables only HEX, RGB, and HSL formats.
|
||||
|
||||
```bash
|
||||
dsc config set --file colorpicker-formats.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# colorpicker-formats.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure visible color formats
|
||||
type: Microsoft.PowerToys/ColorPickerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
VisibleColorFormats:
|
||||
HEX: true
|
||||
RGB: true
|
||||
HSL: true
|
||||
HSV: false
|
||||
CMYK: false
|
||||
HSB: false
|
||||
HSI: false
|
||||
HWB: false
|
||||
NCol: false
|
||||
Decimal: false
|
||||
name: ColorPicker
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Configure for graphic design
|
||||
|
||||
This example configures Color Picker for graphic designers with CMYK support.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
copiedcolorrepresentation = "CMYK"
|
||||
showColorName = $true
|
||||
VisibleColorFormats = @{
|
||||
HEX = $true
|
||||
RGB = $true
|
||||
CMYK = $true
|
||||
HSL = $true
|
||||
HSV = $true
|
||||
}
|
||||
}
|
||||
name = "ColorPicker"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module ColorPicker --input $config
|
||||
```
|
||||
|
||||
### Example 6 - Test configuration
|
||||
|
||||
This example tests whether HEX is the default format.
|
||||
|
||||
```powershell
|
||||
$desired = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
copiedcolorrepresentation = "HEX"
|
||||
}
|
||||
name = "ColorPicker"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
$result = PowerToys.DSC.exe test --resource 'settings' --module ColorPicker `
|
||||
--input $desired | ConvertFrom-Json
|
||||
|
||||
if ($result._inDesiredState) {
|
||||
Write-Host "HEX is the default format"
|
||||
}
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Web development
|
||||
|
||||
Configure for HTML/CSS color codes:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Web developer settings
|
||||
type: Microsoft.PowerToys/ColorPickerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
copiedcolorrepresentation: HEX
|
||||
VisibleColorFormats:
|
||||
HEX: true
|
||||
RGB: true
|
||||
HSL: true
|
||||
name: ColorPicker
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Print design
|
||||
|
||||
Configure for CMYK color space:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Print designer settings
|
||||
type: Microsoft.PowerToys/ColorPickerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
copiedcolorrepresentation: CMYK
|
||||
showColorName: true
|
||||
name: ColorPicker
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [ImageResizer][03]
|
||||
- [PowerToys Color Picker Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./ImageResizer.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/color-picker
|
||||
195
doc/dsc/modules/CropAndLock.md
Normal file
195
doc/dsc/modules/CropAndLock.md
Normal file
@@ -0,0 +1,195 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys CropAndLock module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: CropAndLock Module
|
||||
---
|
||||
|
||||
# CropAndLock Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Crop And Lock utility, which crops and locks portions of windows.
|
||||
|
||||
## Description
|
||||
|
||||
The `CropAndLock` module configures PowerToys Crop And Lock, a utility that allows you to crop a portion of any window and keep it visible as a thumbnail. This is useful for monitoring specific parts of applications, keeping reference information visible, or focusing on particular UI elements.
|
||||
|
||||
## Properties
|
||||
|
||||
The CropAndLock module supports the following configurable properties:
|
||||
|
||||
### Hotkey
|
||||
|
||||
Sets the keyboard shortcut to activate Crop And Lock for the active window.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier.
|
||||
- `ctrl` (boolean) - Ctrl key modifier.
|
||||
- `alt` (boolean) - Alt key modifier.
|
||||
- `shift` (boolean) - Shift key modifier.
|
||||
- `code` (integer) - Virtual key code.
|
||||
- `key` (string) - Key name.
|
||||
|
||||
**Default:** `Win+Ctrl+Shift+T`
|
||||
|
||||
### ReparentHotkey
|
||||
|
||||
Sets the keyboard shortcut to change the parent window of a cropped thumbnail.
|
||||
|
||||
**Type:** object (same structure as Hotkey)
|
||||
|
||||
### ThumbnailOpacity
|
||||
|
||||
Sets the opacity of cropped thumbnails (0-100).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `100`
|
||||
**Default:** `100`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure basic settings with direct execution
|
||||
|
||||
This example sets the Crop And Lock hotkey and thumbnail opacity.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ThumbnailOpacity = 90
|
||||
}
|
||||
name = "CropAndLock"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module CropAndLock --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure hotkeys with DSC
|
||||
|
||||
This example configures custom hotkeys for cropping and reparenting.
|
||||
|
||||
```bash
|
||||
dsc config set --file cropandlock-hotkeys.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# cropandlock-hotkeys.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Crop And Lock hotkeys
|
||||
type: Microsoft.PowerToys/CropAndLockSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
Hotkey:
|
||||
win: true
|
||||
ctrl: true
|
||||
shift: true
|
||||
alt: false
|
||||
code: 84
|
||||
key: T
|
||||
ThumbnailOpacity: 85
|
||||
name: CropAndLock
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Crop And Lock.
|
||||
|
||||
```bash
|
||||
winget configure winget-cropandlock.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-cropandlock.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Crop And Lock
|
||||
type: Microsoft.PowerToys/CropAndLockSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailOpacity: 75
|
||||
name: CropAndLock
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Semi-transparent thumbnails
|
||||
|
||||
This example configures thumbnails to be semi-transparent for overlay use.
|
||||
|
||||
```yaml
|
||||
# cropandlock-transparent.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Semi-transparent thumbnails
|
||||
type: Microsoft.PowerToys/CropAndLockSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailOpacity: 60
|
||||
name: CropAndLock
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Monitoring dashboards
|
||||
|
||||
Keep portions of monitoring tools visible:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Monitoring configuration
|
||||
type: Microsoft.PowerToys/CropAndLockSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailOpacity: 80
|
||||
name: CropAndLock
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Reference material
|
||||
|
||||
Crop and display reference information:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Reference display
|
||||
type: Microsoft.PowerToys/CropAndLockSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailOpacity: 95
|
||||
name: CropAndLock
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [MouseJump][03]
|
||||
- [PowerToys Crop And Lock Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./MouseJump.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/crop-and-lock
|
||||
193
doc/dsc/modules/EnvironmentVariables.md
Normal file
193
doc/dsc/modules/EnvironmentVariables.md
Normal file
@@ -0,0 +1,193 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys EnvironmentVariables module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: EnvironmentVariables Module
|
||||
---
|
||||
|
||||
# EnvironmentVariables Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Environment Variables utility, a quick editor for system and user environment variables.
|
||||
|
||||
## Description
|
||||
|
||||
The `EnvironmentVariables` module configures PowerToys Environment Variables, a utility that provides an enhanced interface for viewing and editing Windows environment variables. It offers a more user-friendly alternative to the standard Windows environment variable editor.
|
||||
|
||||
## Properties
|
||||
|
||||
The EnvironmentVariables module supports the following configurable properties:
|
||||
|
||||
### LaunchAdministrator
|
||||
|
||||
Controls whether the Environment Variables editor launches with administrator privileges by default.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
**Description:** When enabled, the editor will always attempt to launch with elevated permissions, allowing editing of system-wide environment variables.
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Enable admin launch with direct execution
|
||||
|
||||
This example configures the Environment Variables editor to always launch with admin rights.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
LaunchAdministrator = $true
|
||||
}
|
||||
name = "EnvironmentVariables"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module EnvironmentVariables --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure with DSC
|
||||
|
||||
This example enables administrator launch through DSC configuration.
|
||||
|
||||
```bash
|
||||
dsc config set --file environmentvariables-config.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# environmentvariables-config.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Environment Variables editor
|
||||
type: Microsoft.PowerToys/EnvironmentVariablesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: true
|
||||
name: EnvironmentVariables
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Environment Variables for
|
||||
admin launch.
|
||||
|
||||
```bash
|
||||
winget configure winget-envvars.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-envvars.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Environment Variables
|
||||
type: Microsoft.PowerToys/EnvironmentVariablesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: true
|
||||
name: EnvironmentVariables
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Standard user mode
|
||||
|
||||
This example configures for standard user access (no elevation).
|
||||
|
||||
```bash
|
||||
dsc config set --file envvars-user.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# envvars-user.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: User-level Environment Variables
|
||||
type: Microsoft.PowerToys/EnvironmentVariablesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: false
|
||||
name: EnvironmentVariables
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Test admin launch configuration
|
||||
|
||||
This example tests whether admin launch is enabled.
|
||||
|
||||
```powershell
|
||||
$desired = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
LaunchAdministrator = $true
|
||||
}
|
||||
name = "EnvironmentVariables"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
$result = PowerToys.DSC.exe test --resource 'settings' --module EnvironmentVariables --input $desired | ConvertFrom-Json
|
||||
|
||||
if ($result._inDesiredState) {
|
||||
Write-Host "Admin launch is enabled"
|
||||
}
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### System administration
|
||||
|
||||
Configure for system-wide environment variable management:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Admin configuration
|
||||
type: Microsoft.PowerToys/EnvironmentVariablesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: true
|
||||
name: EnvironmentVariables
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Development workstations
|
||||
|
||||
Configure for user-level variable management:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Developer configuration
|
||||
type: Microsoft.PowerToys/EnvironmentVariablesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: false
|
||||
name: EnvironmentVariables
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [Hosts][03]
|
||||
- [PowerToys Environment Variables Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./Hosts.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/environment-variables
|
||||
545
doc/dsc/modules/FancyZones.md
Normal file
545
doc/dsc/modules/FancyZones.md
Normal file
@@ -0,0 +1,545 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys FancyZones module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: FancyZones Module
|
||||
---
|
||||
|
||||
# FancyZones Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the FancyZones utility, a window layout manager that arranges and snaps windows into efficient layouts.
|
||||
|
||||
## Description
|
||||
|
||||
The `FancyZones` module configures PowerToys FancyZones, a window manager
|
||||
utility that helps organize windows into custom layouts called zones.
|
||||
FancyZones allows you to create multiple zone layouts for different displays
|
||||
and quickly snap windows into position using keyboard shortcuts or mouse
|
||||
actions.
|
||||
|
||||
This module controls activation methods, window behavior, zone appearance, editor settings, and other FancyZones preferences.
|
||||
|
||||
## Properties
|
||||
|
||||
The FancyZones module supports the following configurable properties:
|
||||
|
||||
### fancyzones_shiftDrag
|
||||
|
||||
Controls whether holding Shift while dragging a window activates zone snapping.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### fancyzones_mouseSwitch
|
||||
|
||||
Controls whether moving a window across monitors triggers zone selection.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_overrideSnapHotkeys
|
||||
|
||||
Controls whether FancyZones overrides the Windows Snap hotkeys (Win+Arrow keys).
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_moveWindowsAcrossMonitors
|
||||
|
||||
Controls whether moving windows between monitors is enabled.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_moveWindowsBasedOnPosition
|
||||
|
||||
Controls whether windows move to zones based on cursor position rather than window position.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_overlappingZonesAlgorithm
|
||||
|
||||
Determines the algorithm used when multiple zones overlap.
|
||||
|
||||
**Type:** integer
|
||||
**Allowed values:**
|
||||
|
||||
- `0` - Smallest zone
|
||||
- `1` - Largest zone
|
||||
- `2` - Positional (based on cursor/window position)
|
||||
|
||||
**Default:** `0`
|
||||
|
||||
### fancyzones_displayOrWorkAreaChange_moveWindows
|
||||
|
||||
Controls whether windows are moved to fit when display or work area changes.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_zoneSetChange_flashZones
|
||||
|
||||
Controls whether zones flash briefly when the zone set changes.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_zoneSetChange_moveWindows
|
||||
|
||||
Controls whether windows are automatically moved when the zone set changes.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_appLastZone_moveWindows
|
||||
|
||||
Controls whether windows are moved to their last known zone when reopened.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### fancyzones_openWindowOnActiveMonitor
|
||||
|
||||
Controls whether newly opened windows appear on the currently active monitor.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_spanZonesAcrossMonitors
|
||||
|
||||
Controls whether zones can span across multiple monitors.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### fancyzones_makeDraggedWindowTransparent
|
||||
|
||||
Controls whether dragged windows become transparent to show zones underneath.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### fancyzones_zoneColor
|
||||
|
||||
Sets the color of zone areas.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Example:** `"#0078D7"`
|
||||
**Default:** `"#0078D7"`
|
||||
|
||||
### fancyzones_zoneBorderColor
|
||||
|
||||
Sets the color of zone borders.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Example:** `"#FFFFFF"`
|
||||
**Default:** `"#FFFFFF"`
|
||||
|
||||
### fancyzones_zoneHighlightColor
|
||||
|
||||
Sets the highlight color when a zone is activated.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Example:** `"#0078D7"`
|
||||
**Default:** `"#0078D7"`
|
||||
|
||||
### fancyzones_highlightOpacity
|
||||
|
||||
Sets the opacity of zone highlights (0-100).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `100`
|
||||
**Default:** `50`
|
||||
|
||||
### fancyzones_editorHotkey
|
||||
|
||||
Sets the keyboard shortcut to open the FancyZones editor.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Win+Shift+~`
|
||||
|
||||
### fancyzones_windowSwitching
|
||||
|
||||
Controls whether window switching with arrow keys is enabled.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### fancyzones_nextTabHotkey
|
||||
|
||||
Sets the keyboard shortcut to switch to the next tab/window in a zone.
|
||||
|
||||
**Type:** object (same structure as fancyzones_editorHotkey)
|
||||
|
||||
### fancyzones_prevTabHotkey
|
||||
|
||||
Sets the keyboard shortcut to switch to the previous tab/window in a zone.
|
||||
|
||||
**Type:** object (same structure as fancyzones_editorHotkey)
|
||||
|
||||
### fancyzones_excludedApps
|
||||
|
||||
List of applications excluded from FancyZones snapping.
|
||||
|
||||
**Type:** string (newline-separated list of executable names)
|
||||
**Example:** `"Notepad.exe\nCalc.exe"`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Enable basic zone snapping with direct execution
|
||||
|
||||
This example enables Shift-drag zone snapping and mouse-based monitor switching.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
fancyzones_shiftDrag = $true
|
||||
fancyzones_mouseSwitch = $true
|
||||
}
|
||||
name = "FancyZones"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module FancyZones --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure window movement behavior with DSC
|
||||
|
||||
This example configures how windows behave when displays or zones change.
|
||||
|
||||
```bash
|
||||
dsc config set --file fancyzones-window-behavior.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# fancyzones-window-behavior.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure FancyZones window behavior
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_displayOrWorkAreaChange_moveWindows: true
|
||||
fancyzones_zoneSetChange_moveWindows: true
|
||||
fancyzones_appLastZone_moveWindows: true
|
||||
fancyzones_moveWindowsAcrossMonitors: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Customize zone appearance with WinGet
|
||||
|
||||
This example installs PowerToys and configures custom zone colors and
|
||||
opacity.
|
||||
|
||||
```bash
|
||||
winget configure winget-fancyzones-appearance.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-fancyzones-appearance.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Customize FancyZones appearance
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_zoneColor: "#2D2D30"
|
||||
fancyzones_zoneBorderColor: "#007ACC"
|
||||
fancyzones_zoneHighlightColor: "#007ACC"
|
||||
fancyzones_highlightOpacity: 75
|
||||
fancyzones_makeDraggedWindowTransparent: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Override Windows Snap hotkeys
|
||||
|
||||
This example configures FancyZones to replace Windows default snap
|
||||
functionality.
|
||||
|
||||
```bash
|
||||
dsc config set --file fancyzones-snap-override.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# fancyzones-snap-override.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Override Windows Snap
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_overrideSnapHotkeys: true
|
||||
fancyzones_moveWindowsBasedOnPosition: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Configure editor hotkey
|
||||
|
||||
This example changes the FancyZones editor hotkey to Ctrl+Shift+Alt+F.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
fancyzones_editorHotkey = @{
|
||||
win = $false
|
||||
ctrl = $true
|
||||
alt = $true
|
||||
shift = $true
|
||||
code = 70 # F key
|
||||
key = "F"
|
||||
}
|
||||
}
|
||||
name = "FancyZones"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module FancyZones --input $config
|
||||
```
|
||||
|
||||
### Example 6 - Exclude applications from zone snapping
|
||||
|
||||
This example configures FancyZones to ignore specific applications.
|
||||
|
||||
```yaml
|
||||
# fancyzones-exclusions.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Exclude apps from FancyZones
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_excludedApps: |
|
||||
Notepad.exe
|
||||
Calculator.exe
|
||||
mspaint.exe
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 7 - Multi-monitor configuration
|
||||
|
||||
This example configures FancyZones for optimal multi-monitor workflow.
|
||||
|
||||
```bash
|
||||
dsc config set --file fancyzones-multimonitor.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# fancyzones-multimonitor.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Multi-monitor FancyZones setup
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_shiftDrag: true
|
||||
fancyzones_mouseSwitch: true
|
||||
fancyzones_moveWindowsAcrossMonitors: true
|
||||
fancyzones_spanZonesAcrossMonitors: false
|
||||
fancyzones_openWindowOnActiveMonitor: true
|
||||
fancyzones_displayOrWorkAreaChange_moveWindows: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 8 - Complete FancyZones configuration with WinGet
|
||||
|
||||
This example shows a comprehensive FancyZones setup with installation.
|
||||
|
||||
```bash
|
||||
winget configure winget-fancyzones-complete.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-fancyzones-complete.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Enable FancyZones
|
||||
type: Microsoft.PowerToys/AppSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
Enabled:
|
||||
FancyZones: true
|
||||
name: App
|
||||
version: 1.0
|
||||
|
||||
- name: Configure FancyZones
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
# Activation
|
||||
fancyzones_shiftDrag: true
|
||||
fancyzones_mouseSwitch: true
|
||||
fancyzones_overrideSnapHotkeys: false
|
||||
|
||||
# Window behavior
|
||||
fancyzones_moveWindowsAcrossMonitors: true
|
||||
fancyzones_moveWindowsBasedOnPosition: false
|
||||
fancyzones_displayOrWorkAreaChange_moveWindows: true
|
||||
fancyzones_zoneSetChange_moveWindows: false
|
||||
fancyzones_appLastZone_moveWindows: true
|
||||
|
||||
# Appearance
|
||||
fancyzones_makeDraggedWindowTransparent: true
|
||||
fancyzones_zoneColor: "#0078D7"
|
||||
fancyzones_zoneBorderColor: "#FFFFFF"
|
||||
fancyzones_zoneHighlightColor: "#0078D7"
|
||||
fancyzones_highlightOpacity: 50
|
||||
|
||||
# Multi-monitor
|
||||
fancyzones_openWindowOnActiveMonitor: true
|
||||
fancyzones_spanZonesAcrossMonitors: false
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 9 - Test FancyZones configuration
|
||||
|
||||
This example tests whether FancyZones is configured for multi-monitor use.
|
||||
|
||||
```powershell
|
||||
$desired = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
fancyzones_moveWindowsAcrossMonitors = $true
|
||||
fancyzones_openWindowOnActiveMonitor = $true
|
||||
}
|
||||
name = "FancyZones"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
$result = PowerToys.DSC.exe test --resource 'settings' --module FancyZones `
|
||||
--input $desired | ConvertFrom-Json
|
||||
|
||||
if ($result._inDesiredState) {
|
||||
Write-Host "FancyZones is configured for multi-monitor"
|
||||
} else {
|
||||
Write-Host "FancyZones configuration needs updating"
|
||||
}
|
||||
```
|
||||
|
||||
### Example 10 - Get FancyZones schema
|
||||
|
||||
This example retrieves the complete JSON schema for FancyZones properties.
|
||||
|
||||
```powershell
|
||||
PowerToys.DSC.exe schema --resource 'settings' --module FancyZones | `
|
||||
ConvertFrom-Json | ConvertTo-Json -Depth 10
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Development workflow
|
||||
|
||||
Configure FancyZones for efficient development with IDE, browser, and terminal windows:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Developer layout
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_shiftDrag: true
|
||||
fancyzones_overrideSnapHotkeys: true
|
||||
fancyzones_appLastZone_moveWindows: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Presentation mode
|
||||
|
||||
Optimize window management for presentations and screen sharing:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Presentation layout
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_openWindowOnActiveMonitor: true
|
||||
fancyzones_highlightOpacity: 30
|
||||
fancyzones_makeDraggedWindowTransparent: false
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Home office setup
|
||||
|
||||
Configure for docking/undocking laptop scenarios:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Home office configuration
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_displayOrWorkAreaChange_moveWindows: true
|
||||
fancyzones_moveWindowsAcrossMonitors: true
|
||||
fancyzones_appLastZone_moveWindows: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [Peek][03]
|
||||
- [PowerToys FancyZones Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./Peek.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/fancyzones
|
||||
179
doc/dsc/modules/FileLocksmith.md
Normal file
179
doc/dsc/modules/FileLocksmith.md
Normal file
@@ -0,0 +1,179 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys FileLocksmith module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: FileLocksmith Module
|
||||
---
|
||||
|
||||
# FileLocksmith Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the File Locksmith utility, which identifies
|
||||
processes that are locking files or folders.
|
||||
|
||||
## Description
|
||||
|
||||
The `FileLocksmith` module configures PowerToys File Locksmith, a Windows
|
||||
shell extension that helps identify which processes are using (locking)
|
||||
specific files or folders. It integrates with the Windows Explorer context
|
||||
menu for easy access.
|
||||
|
||||
## Properties
|
||||
|
||||
The FileLocksmith module supports the following configurable properties:
|
||||
|
||||
### ExtendedContextMenuOnly
|
||||
|
||||
Controls whether File Locksmith appears only in the extended context menu.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
**Description:** When `true`, File Locksmith only appears in the context menu
|
||||
when you hold Shift while right-clicking. When `false`, it appears in the
|
||||
standard context menu.
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Show in standard context menu with direct execution
|
||||
|
||||
This example configures File Locksmith to appear in the standard context menu.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ExtendedContextMenuOnly = $false
|
||||
}
|
||||
name = "FileLocksmith"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module FileLocksmith `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Extended menu only with DSC
|
||||
|
||||
This example configures File Locksmith to appear only in the extended
|
||||
context menu.
|
||||
|
||||
```bash
|
||||
dsc config set --file filelocksmith-extended.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# filelocksmith-extended.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure File Locksmith for extended menu
|
||||
type: Microsoft.PowerToys/FileLocksmithSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExtendedContextMenuOnly: true
|
||||
name: FileLocksmith
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures File Locksmith for standard
|
||||
menu access.
|
||||
|
||||
```bash
|
||||
winget configure winget-filelocksmith.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-filelocksmith.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure File Locksmith
|
||||
type: Microsoft.PowerToys/FileLocksmithSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExtendedContextMenuOnly: false
|
||||
name: FileLocksmith
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Minimize context menu clutter
|
||||
|
||||
This example configures for extended menu to reduce clutter.
|
||||
|
||||
```bash
|
||||
dsc config set --file filelocksmith-minimal.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# filelocksmith-minimal.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Minimal context menu
|
||||
type: Microsoft.PowerToys/FileLocksmithSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExtendedContextMenuOnly: true
|
||||
name: FileLocksmith
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### System administration
|
||||
|
||||
Quick access for troubleshooting file locks:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Admin quick access
|
||||
type: Microsoft.PowerToys/FileLocksmithSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExtendedContextMenuOnly: false
|
||||
name: FileLocksmith
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Clean context menu
|
||||
|
||||
Reduce menu clutter for casual users:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Clean menu
|
||||
type: Microsoft.PowerToys/FileLocksmithSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExtendedContextMenuOnly: true
|
||||
name: FileLocksmith
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [RegistryPreview][03]
|
||||
- [PowerToys File Locksmith Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./RegistryPreview.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/file-locksmith
|
||||
288
doc/dsc/modules/FindMyMouse.md
Normal file
288
doc/dsc/modules/FindMyMouse.md
Normal file
@@ -0,0 +1,288 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys FindMyMouse module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: FindMyMouse Module
|
||||
---
|
||||
|
||||
# FindMyMouse Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Find My Mouse utility, which helps locate your
|
||||
mouse cursor on the screen.
|
||||
|
||||
## Description
|
||||
|
||||
The `FindMyMouse` module configures PowerToys Find My Mouse, a utility that
|
||||
highlights your mouse cursor location when you press the Ctrl key. This is
|
||||
particularly useful on large or multiple displays where the cursor can be
|
||||
difficult to locate.
|
||||
|
||||
## Properties
|
||||
|
||||
The FindMyMouse module supports the following configurable properties:
|
||||
|
||||
### DoNotActivateOnGameMode
|
||||
|
||||
Controls whether Find My Mouse is disabled during game mode.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
**Description:** When enabled, Find My Mouse will not activate when Windows
|
||||
game mode is active.
|
||||
|
||||
### BackgroundColor
|
||||
|
||||
Sets the background color of the spotlight effect.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Default:** `"#000000"` (black)
|
||||
|
||||
### SpotlightColor
|
||||
|
||||
Sets the color of the spotlight circle around the cursor.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Default:** `"#FFFFFF"` (white)
|
||||
|
||||
### OverlayOpacity
|
||||
|
||||
Sets the opacity of the background overlay (0-100).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `100`
|
||||
**Default:** `50`
|
||||
|
||||
### SpotlightRadius
|
||||
|
||||
Sets the radius of the spotlight in pixels.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `50` to `500`
|
||||
**Default:** `100`
|
||||
|
||||
### AnimationDurationMs
|
||||
|
||||
Sets the duration of the spotlight animation in milliseconds.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `5000`
|
||||
**Default:** `500`
|
||||
|
||||
### SpotlightInitialZoom
|
||||
|
||||
Sets the initial zoom level of the spotlight effect.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `100` to `1000`
|
||||
**Default:** `200`
|
||||
|
||||
### ExcludedApps
|
||||
|
||||
List of applications where Find My Mouse is disabled.
|
||||
|
||||
**Type:** string (newline-separated list of executable names)
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure spotlight appearance with direct execution
|
||||
|
||||
This example customizes the spotlight colors and radius.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
BackgroundColor = "#000000"
|
||||
SpotlightColor = "#00FF00"
|
||||
SpotlightRadius = 150
|
||||
OverlayOpacity = 60
|
||||
}
|
||||
name = "FindMyMouse"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module FindMyMouse --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure animation with DSC
|
||||
|
||||
This example customizes the spotlight animation behavior.
|
||||
|
||||
```bash
|
||||
dsc config set --file findmymouse-animation.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# findmymouse-animation.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Find My Mouse animation
|
||||
type: Microsoft.PowerToys/FindMyMouseSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
AnimationDurationMs: 750
|
||||
SpotlightInitialZoom: 300
|
||||
SpotlightRadius: 120
|
||||
name: FindMyMouse
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Find My Mouse with custom
|
||||
colors.
|
||||
|
||||
```bash
|
||||
winget configure winget-findmymouse.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-findmymouse.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Find My Mouse
|
||||
type: Microsoft.PowerToys/FindMyMouseSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
BackgroundColor: "#000000"
|
||||
SpotlightColor: "#0078D7"
|
||||
OverlayOpacity: 70
|
||||
SpotlightRadius: 140
|
||||
DoNotActivateOnGameMode: true
|
||||
name: FindMyMouse
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Subtle configuration
|
||||
|
||||
This example creates a subtle, less intrusive spotlight effect.
|
||||
|
||||
```bash
|
||||
dsc config set --file findmymouse-subtle.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# findmymouse-subtle.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Subtle spotlight
|
||||
type: Microsoft.PowerToys/FindMyMouseSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
OverlayOpacity: 30
|
||||
SpotlightRadius: 100
|
||||
AnimationDurationMs: 300
|
||||
name: FindMyMouse
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - High visibility configuration
|
||||
|
||||
This example creates a high-visibility spotlight for accessibility.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
BackgroundColor = "#000000"
|
||||
SpotlightColor = "#FFFF00"
|
||||
OverlayOpacity = 80
|
||||
SpotlightRadius = 200
|
||||
SpotlightInitialZoom = 400
|
||||
}
|
||||
name = "FindMyMouse"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module FindMyMouse --input $config
|
||||
```
|
||||
|
||||
### Example 6 - Disable during gaming
|
||||
|
||||
This example ensures Find My Mouse doesn't interfere with games.
|
||||
|
||||
```bash
|
||||
dsc config set --file findmymouse-gaming.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# findmymouse-gaming.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Gaming configuration
|
||||
type: Microsoft.PowerToys/FindMyMouseSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
DoNotActivateOnGameMode: true
|
||||
name: FindMyMouse
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Large displays
|
||||
|
||||
Configure for high visibility on large screens:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Large display configuration
|
||||
type: Microsoft.PowerToys/FindMyMouseSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
SpotlightRadius: 180
|
||||
OverlayOpacity: 70
|
||||
SpotlightColor: "#FFFFFF"
|
||||
name: FindMyMouse
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Accessibility
|
||||
|
||||
Configure for maximum visibility:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Accessibility configuration
|
||||
type: Microsoft.PowerToys/FindMyMouseSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
SpotlightColor: "#FFFF00"
|
||||
OverlayOpacity: 80
|
||||
SpotlightRadius: 200
|
||||
AnimationDurationMs: 1000
|
||||
name: FindMyMouse
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [MouseHighlighter][03]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./MouseHighlighter.md
|
||||
200
doc/dsc/modules/Hosts.md
Normal file
200
doc/dsc/modules/Hosts.md
Normal file
@@ -0,0 +1,200 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys Hosts module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: Hosts Module
|
||||
---
|
||||
|
||||
# Hosts Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Hosts File Editor utility, a quick editor for
|
||||
the Windows hosts file.
|
||||
|
||||
## Description
|
||||
|
||||
The `Hosts` module configures PowerToys Hosts File Editor, a utility that
|
||||
provides a user-friendly interface for viewing and editing the Windows hosts
|
||||
file. It simplifies the process of adding, modifying, and managing DNS
|
||||
entries in the hosts file.
|
||||
|
||||
## Properties
|
||||
|
||||
The Hosts module supports the following configurable properties:
|
||||
|
||||
### LaunchAdministrator
|
||||
|
||||
Controls whether the Hosts File Editor launches with administrator privileges
|
||||
by default.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
**Description:** When enabled, the editor will always attempt to launch with
|
||||
elevated permissions, which is required to edit the hosts file.
|
||||
|
||||
### LoopbackDuplicates
|
||||
|
||||
Controls how duplicate loopback addresses are handled.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### AdditionalLinesPosition
|
||||
|
||||
Controls where additional lines are positioned when editing entries.
|
||||
|
||||
**Type:** integer
|
||||
**Allowed values:**
|
||||
|
||||
- `0` - Top
|
||||
- `1` - Bottom
|
||||
|
||||
**Default:** `0`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Enable admin launch with direct execution
|
||||
|
||||
This example configures the Hosts editor to always launch with admin rights.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
LaunchAdministrator = $true
|
||||
}
|
||||
name = "Hosts"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Hosts --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure with DSC
|
||||
|
||||
This example enables administrator launch and configures line positioning.
|
||||
|
||||
```bash
|
||||
dsc config set --file hosts-config.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# hosts-config.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Hosts File Editor
|
||||
type: Microsoft.PowerToys/HostsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: true
|
||||
AdditionalLinesPosition: 1
|
||||
name: Hosts
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures the Hosts editor for admin
|
||||
launch.
|
||||
|
||||
```bash
|
||||
winget configure winget-hosts.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-hosts.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Hosts File Editor
|
||||
type: Microsoft.PowerToys/HostsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: true
|
||||
LoopbackDuplicates: false
|
||||
name: Hosts
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Development configuration
|
||||
|
||||
This example configures for development use with new entries at the bottom.
|
||||
|
||||
```bash
|
||||
dsc config set --file hosts-development.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# hosts-development.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Development hosts configuration
|
||||
type: Microsoft.PowerToys/HostsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: true
|
||||
AdditionalLinesPosition: 1
|
||||
name: Hosts
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### System administration
|
||||
|
||||
Configure for frequent hosts file editing:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Admin configuration
|
||||
type: Microsoft.PowerToys/HostsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: true
|
||||
name: Hosts
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Web development
|
||||
|
||||
Configure for development environment management:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Developer configuration
|
||||
type: Microsoft.PowerToys/HostsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchAdministrator: true
|
||||
AdditionalLinesPosition: 1
|
||||
name: Hosts
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [KeyboardManager][03]
|
||||
- [PowerToys Hosts File Editor Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./KeyboardManager.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/hosts-file-editor
|
||||
349
doc/dsc/modules/ImageResizer.md
Normal file
349
doc/dsc/modules/ImageResizer.md
Normal file
@@ -0,0 +1,349 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys ImageResizer module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: ImageResizer Module
|
||||
---
|
||||
|
||||
# ImageResizer Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Image Resizer utility, which provides quick
|
||||
image resizing from the Windows Explorer context menu.
|
||||
|
||||
## Description
|
||||
|
||||
The `ImageResizer` module configures PowerToys Image Resizer, a Windows shell
|
||||
extension that allows you to resize one or multiple images directly from the
|
||||
File Explorer context menu. It supports custom size presets and various
|
||||
resize options.
|
||||
|
||||
## Properties
|
||||
|
||||
The ImageResizer module supports the following configurable properties:
|
||||
|
||||
### ImageResizerSizes
|
||||
|
||||
Defines the preset sizes available in the Image Resizer interface.
|
||||
|
||||
**Type:** array of objects
|
||||
**Object properties:**
|
||||
|
||||
- `Name` (string) - Display name for the preset
|
||||
- `Width` (integer) - Width value
|
||||
- `Height` (integer) - Height value
|
||||
- `Unit` (string) - Unit of measurement: `"Pixel"`, `"Percent"`, `"Centimeter"`, `"Inch"`
|
||||
- `Fit` (string) - Resize mode: `"Fit"`, `"Fill"`, `"Stretch"`
|
||||
|
||||
### ImageresizerSelectedSizeIndex
|
||||
|
||||
Sets the default selected size preset (0-based index).
|
||||
|
||||
**Type:** integer
|
||||
**Default:** `0`
|
||||
|
||||
### ImageresizerShrinkOnly
|
||||
|
||||
Controls whether images are only resized if they're larger than the target size.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### ImageresizerReplace
|
||||
|
||||
Controls whether resized images replace the original files.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### ImageresizerIgnoreOrientation
|
||||
|
||||
Controls whether EXIF orientation data is ignored.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### ImageresizerJpegQualityLevel
|
||||
|
||||
Sets the JPEG quality level for resized images (1-100).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `1` to `100`
|
||||
**Default:** `90`
|
||||
|
||||
### ImageresizerPngInterlaceOption
|
||||
|
||||
Sets the PNG interlace option.
|
||||
|
||||
**Type:** integer
|
||||
**Allowed values:**
|
||||
|
||||
- `0` - No interlacing
|
||||
- `1` - Interlaced
|
||||
|
||||
**Default:** `0`
|
||||
|
||||
### ImageresizerTiffCompressOption
|
||||
|
||||
Sets the TIFF compression option.
|
||||
|
||||
**Type:** integer
|
||||
**Allowed values:**
|
||||
|
||||
- `0` - No compression
|
||||
- `1` - LZW compression
|
||||
- `2` - ZIP compression
|
||||
|
||||
**Default:** `0`
|
||||
|
||||
### ImageresizerFileName
|
||||
|
||||
Sets the naming pattern for resized images.
|
||||
|
||||
**Type:** string
|
||||
**Default:** `"%1 (%2)"`
|
||||
**Placeholders:**
|
||||
|
||||
- `%1` - Original filename
|
||||
- `%2` - Size name
|
||||
- `%3` - Selected width
|
||||
- `%4` - Selected height
|
||||
- `%5` - Actual width
|
||||
- `%6` - Actual height
|
||||
|
||||
### ImageresizerKeepDateModified
|
||||
|
||||
Controls whether the original file's modified date is preserved.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### ImageresizerFallbackEncoder
|
||||
|
||||
Sets the fallback encoder for unsupported formats.
|
||||
|
||||
**Type:** string
|
||||
**Allowed values:** `"png"`, `"jpg"`, `"bmp"`, `"tiff"`, `"gif"`
|
||||
**Default:** `"png"`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure custom size presets with direct execution
|
||||
|
||||
This example defines custom image resize presets.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ImageResizerSizes = @(
|
||||
@{
|
||||
Name = "Small"
|
||||
Width = 640
|
||||
Height = 480
|
||||
Unit = "Pixel"
|
||||
Fit = "Fit"
|
||||
},
|
||||
@{
|
||||
Name = "Medium"
|
||||
Width = 1280
|
||||
Height = 720
|
||||
Unit = "Pixel"
|
||||
Fit = "Fit"
|
||||
},
|
||||
@{
|
||||
Name = "Large"
|
||||
Width = 1920
|
||||
Height = 1080
|
||||
Unit = "Pixel"
|
||||
Fit = "Fit"
|
||||
}
|
||||
)
|
||||
}
|
||||
name = "ImageResizer"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module ImageResizer `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure quality settings with DSC
|
||||
|
||||
This example configures image quality and format options.
|
||||
|
||||
```bash
|
||||
dsc config set --file imageresizer-quality.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# imageresizer-quality.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Image Resizer quality
|
||||
type: Microsoft.PowerToys/ImageResizerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ImageresizerJpegQualityLevel: 95
|
||||
ImageresizerShrinkOnly: true
|
||||
ImageresizerKeepDateModified: true
|
||||
name: ImageResizer
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Image Resizer with
|
||||
web-optimized presets.
|
||||
|
||||
```bash
|
||||
winget configure winget-imageresizer.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-imageresizer.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Image Resizer
|
||||
type: Microsoft.PowerToys/ImageResizerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ImageResizerSizes:
|
||||
- Name: Thumbnail
|
||||
Width: 320
|
||||
Height: 240
|
||||
Unit: Pixel
|
||||
Fit: Fit
|
||||
- Name: Web Small
|
||||
Width: 800
|
||||
Height: 600
|
||||
Unit: Pixel
|
||||
Fit: Fit
|
||||
- Name: Web Large
|
||||
Width: 1920
|
||||
Height: 1080
|
||||
Unit: Pixel
|
||||
Fit: Fit
|
||||
ImageresizerJpegQualityLevel: 85
|
||||
ImageresizerFileName: "%1_resized_%2"
|
||||
name: ImageResizer
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Photography workflow
|
||||
|
||||
This example configures for photography with high quality and metadata
|
||||
preservation.
|
||||
|
||||
```bash
|
||||
dsc config set --file imageresizer-photo.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# imageresizer-photography.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Photography configuration
|
||||
type: Microsoft.PowerToys/ImageResizerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ImageresizerJpegQualityLevel: 100
|
||||
ImageresizerKeepDateModified: true
|
||||
ImageresizerIgnoreOrientation: false
|
||||
ImageresizerShrinkOnly: true
|
||||
name: ImageResizer
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Social media presets
|
||||
|
||||
This example defines presets for social media platforms.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ImageResizerSizes = @(
|
||||
@{ Name = "Instagram Square"; Width = 1080; Height = 1080; Unit = "Pixel"; Fit = "Fill" },
|
||||
@{ Name = "Instagram Portrait"; Width = 1080; Height = 1350; Unit = "Pixel"; Fit = "Fill" },
|
||||
@{ Name = "Facebook Cover"; Width = 820; Height = 312; Unit = "Pixel"; Fit = "Fill" },
|
||||
@{ Name = "Twitter Header"; Width = 1500; Height = 500; Unit = "Pixel"; Fit = "Fill" }
|
||||
)
|
||||
ImageresizerJpegQualityLevel = 90
|
||||
}
|
||||
name = "ImageResizer"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module ImageResizer `
|
||||
--input $config
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Web development
|
||||
|
||||
Configure for web-optimized images:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Web optimization
|
||||
type: Microsoft.PowerToys/ImageResizerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ImageresizerJpegQualityLevel: 85
|
||||
ImageresizerShrinkOnly: true
|
||||
name: ImageResizer
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Content creation
|
||||
|
||||
Configure for social media and content platforms:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Content creation
|
||||
type: Microsoft.PowerToys/ImageResizerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ImageResizerSizes:
|
||||
- Name: HD
|
||||
Width: 1920
|
||||
Height: 1080
|
||||
Unit: Pixel
|
||||
Fit: Fit
|
||||
ImageresizerJpegQualityLevel: 90
|
||||
name: ImageResizer
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [MeasureTool][03]
|
||||
- [PowerToys Image Resizer Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./MeasureTool.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/image-resizer
|
||||
145
doc/dsc/modules/KeyboardManager.md
Normal file
145
doc/dsc/modules/KeyboardManager.md
Normal file
@@ -0,0 +1,145 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys KeyboardManager module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: KeyboardManager Module
|
||||
---
|
||||
|
||||
# KeyboardManager Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Keyboard Manager utility, which allows key
|
||||
remapping and custom keyboard shortcuts.
|
||||
|
||||
## Description
|
||||
|
||||
The `KeyboardManager` module configures PowerToys Keyboard Manager, a utility
|
||||
that enables you to remap keys and create custom keyboard shortcuts. It
|
||||
allows reassigning keys, creating application-specific remappings, and
|
||||
defining shortcuts that run programs or commands.
|
||||
|
||||
## Properties
|
||||
|
||||
The KeyboardManager module supports the following configurable properties:
|
||||
|
||||
### Enabled
|
||||
|
||||
Controls whether Keyboard Manager is enabled.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Enable Keyboard Manager with direct execution
|
||||
|
||||
This example enables the Keyboard Manager utility.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
Enabled = $true
|
||||
}
|
||||
name = "KeyboardManager"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module KeyboardManager --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure with DSC
|
||||
|
||||
This example enables Keyboard Manager through DSC configuration.
|
||||
|
||||
```bash
|
||||
dsc config set --file keyboardmanager-config.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# keyboardmanager-config.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Enable Keyboard Manager
|
||||
type: Microsoft.PowerToys/KeyboardManagerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
Enabled: true
|
||||
name: KeyboardManager
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and enables Keyboard Manager.
|
||||
|
||||
```bash
|
||||
winget configure winget-keyboardmanager.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-keyboardmanager.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Enable Keyboard Manager
|
||||
type: Microsoft.PowerToys/KeyboardManagerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
Enabled: true
|
||||
name: KeyboardManager
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Important notes
|
||||
|
||||
> **Note:** The Keyboard Manager module DSC configuration controls the enabled state only. Key remappings and shortcut definitions are managed through the Keyboard Manager UI and stored separately. This design ensures that complex remapping configurations are not accidentally overwritten by DSC operations.
|
||||
|
||||
To configure key remappings:
|
||||
1. Enable Keyboard Manager using DSC
|
||||
2. Open PowerToys Settings
|
||||
3. Navigate to Keyboard Manager
|
||||
4. Use "Remap a key" or "Remap a shortcut" to configure specific mappings
|
||||
|
||||
## Use cases
|
||||
|
||||
### Enable for deployment
|
||||
|
||||
Enable Keyboard Manager on new workstations:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Enable Keyboard Manager
|
||||
type: Microsoft.PowerToys/KeyboardManagerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
Enabled: true
|
||||
name: KeyboardManager
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [PowerOCR][03]
|
||||
- [PowerToys Keyboard Manager Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./PowerOCR.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/keyboard-manager
|
||||
254
doc/dsc/modules/MeasureTool.md
Normal file
254
doc/dsc/modules/MeasureTool.md
Normal file
@@ -0,0 +1,254 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys MeasureTool module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: MeasureTool Module
|
||||
---
|
||||
|
||||
# MeasureTool Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Measure Tool (Screen Ruler) utility, which
|
||||
measures pixels on your screen.
|
||||
|
||||
## Description
|
||||
|
||||
The `MeasureTool` module configures PowerToys Measure Tool (also known as
|
||||
Screen Ruler), a utility that allows you to measure the distance between two
|
||||
points on your screen in pixels. It's useful for designers, developers, and
|
||||
anyone who needs to measure UI elements or screen distances.
|
||||
|
||||
## Properties
|
||||
|
||||
The MeasureTool module supports the following configurable properties:
|
||||
|
||||
### ActivationShortcut
|
||||
|
||||
Sets the keyboard shortcut to activate the measure tool.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Win+Shift+M`
|
||||
|
||||
### ContinuousCapture
|
||||
|
||||
Controls whether continuous capture mode is enabled.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### DrawFeetOnCross
|
||||
|
||||
Controls whether measurement lines extend to screen edges.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### PerColorChannelEdgeDetection
|
||||
|
||||
Controls whether edge detection is per-color-channel or luminosity-based.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### PixelTolerance
|
||||
|
||||
Sets the pixel tolerance for edge detection (0-255).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `255`
|
||||
**Default:** `30`
|
||||
|
||||
### MeasureCrossColor
|
||||
|
||||
Sets the color of the measurement crosshair.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBBAA"` (with alpha)
|
||||
**Default:** `"#FF4500FF"`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure activation shortcut with direct execution
|
||||
|
||||
This example customizes the measure tool activation shortcut.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ActivationShortcut = @{
|
||||
win = $true
|
||||
ctrl = $false
|
||||
alt = $false
|
||||
shift = $true
|
||||
code = 77
|
||||
key = "M"
|
||||
}
|
||||
}
|
||||
name = "MeasureTool"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module MeasureTool `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure measurement appearance with DSC
|
||||
|
||||
This example customizes the crosshair color and measurement behavior.
|
||||
|
||||
```bash
|
||||
dsc config set --file measuretool-appearance.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# measuretool-appearance.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Measure Tool appearance
|
||||
type: Microsoft.PowerToys/MeasureToolSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
MeasureCrossColor: "#00FF00FF"
|
||||
DrawFeetOnCross: true
|
||||
ContinuousCapture: false
|
||||
name: MeasureTool
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Measure Tool with edge
|
||||
detection.
|
||||
|
||||
```bash
|
||||
winget configure winget-measuretool.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-measuretool.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Measure Tool
|
||||
type: Microsoft.PowerToys/MeasureToolSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PixelTolerance: 20
|
||||
PerColorChannelEdgeDetection: true
|
||||
DrawFeetOnCross: true
|
||||
name: MeasureTool
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - High contrast configuration
|
||||
|
||||
This example configures for high visibility measurements.
|
||||
|
||||
```bash
|
||||
dsc config set --file measuretool-highcontrast.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# measuretool-highcontrast.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: High contrast Measure Tool
|
||||
type: Microsoft.PowerToys/MeasureToolSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
MeasureCrossColor: "#FFFF00FF"
|
||||
DrawFeetOnCross: true
|
||||
name: MeasureTool
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Continuous capture mode
|
||||
|
||||
This example enables continuous capture for repeated measurements.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ContinuousCapture = $true
|
||||
PixelTolerance = 25
|
||||
}
|
||||
name = "MeasureTool"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module MeasureTool --input $config
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### UI/UX design
|
||||
|
||||
Configure for design work with precise measurements:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Design configuration
|
||||
type: Microsoft.PowerToys/MeasureToolSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PixelTolerance: 15
|
||||
DrawFeetOnCross: true
|
||||
name: MeasureTool
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Web development
|
||||
|
||||
Configure for layout debugging:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Developer configuration
|
||||
type: Microsoft.PowerToys/MeasureToolSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ContinuousCapture: true
|
||||
MeasureCrossColor: "#0078D7FF"
|
||||
name: MeasureTool
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [PowerAccent][03]
|
||||
- [PowerToys Screen Ruler Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./PowerAccent.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/screen-ruler
|
||||
276
doc/dsc/modules/MouseHighlighter.md
Normal file
276
doc/dsc/modules/MouseHighlighter.md
Normal file
@@ -0,0 +1,276 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys MouseHighlighter module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: MouseHighlighter Module
|
||||
---
|
||||
|
||||
# MouseHighlighter Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Mouse Highlighter utility, which highlights
|
||||
your mouse cursor and clicks.
|
||||
|
||||
## Description
|
||||
|
||||
The `MouseHighlighter` module configures PowerToys Mouse Highlighter, a
|
||||
utility that adds visual highlights to your mouse cursor and click locations.
|
||||
This is useful for presentations, tutorials, screen recordings, or
|
||||
accessibility purposes.
|
||||
|
||||
## Properties
|
||||
|
||||
The MouseHighlighter module supports the following configurable properties:
|
||||
|
||||
### ActivationShortcut
|
||||
|
||||
Sets the keyboard shortcut to toggle mouse highlighting.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Win+Shift+H`
|
||||
|
||||
### LeftButtonClickColor
|
||||
|
||||
Sets the color for left mouse button clicks.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Default:** `"#FFFF00"` (yellow)
|
||||
|
||||
### RightButtonClickColor
|
||||
|
||||
Sets the color for right mouse button clicks.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Default:** `"#0000FF"` (blue)
|
||||
|
||||
### HighlightOpacity
|
||||
|
||||
Sets the opacity of click highlights (0-100).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `100`
|
||||
**Default:** `160`
|
||||
|
||||
### HighlightRadius
|
||||
|
||||
Sets the radius of click highlights in pixels.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `1` to `500`
|
||||
**Default:** `20`
|
||||
|
||||
### HighlightFadeDelayMs
|
||||
|
||||
Sets how long highlights remain visible in milliseconds.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `10000`
|
||||
**Default:** `500`
|
||||
|
||||
### HighlightFadeDurationMs
|
||||
|
||||
Sets the duration of the highlight fade animation in milliseconds.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `10000`
|
||||
**Default:** `250`
|
||||
|
||||
### AutoActivate
|
||||
|
||||
Controls whether Mouse Highlighter activates automatically during presentations.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure highlight colors with direct execution
|
||||
|
||||
This example customizes the click highlight colors.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
LeftButtonClickColor = "#00FF00"
|
||||
RightButtonClickColor = "#FF0000"
|
||||
HighlightOpacity = 200
|
||||
}
|
||||
name = "MouseHighlighter"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module MouseHighlighter `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure highlight animation with DSC
|
||||
|
||||
This example customizes the animation timing and appearance.
|
||||
|
||||
```bash
|
||||
dsc config set --file mousehighlighter-animation.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# mousehighlighter-animation.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Mouse Highlighter animation
|
||||
type: Microsoft.PowerToys/MouseHighlighterSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
HighlightRadius: 30
|
||||
HighlightFadeDelayMs: 750
|
||||
HighlightFadeDurationMs: 400
|
||||
name: MouseHighlighter
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure for presentations with WinGet
|
||||
|
||||
This example installs PowerToys and configures Mouse Highlighter for
|
||||
presentations.
|
||||
|
||||
```bash
|
||||
winget configure winget-mousehighlighter.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-mousehighlighter.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Mouse Highlighter for presentations
|
||||
type: Microsoft.PowerToys/MouseHighlighterSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LeftButtonClickColor: "#FFD700"
|
||||
RightButtonClickColor: "#FF4500"
|
||||
HighlightOpacity: 220
|
||||
HighlightRadius: 25
|
||||
AutoActivate: true
|
||||
name: MouseHighlighter
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Subtle highlighting
|
||||
|
||||
This example configures subtle, less distracting highlights.
|
||||
|
||||
```bash
|
||||
dsc config set --file mousehighlighter-subtle.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# mousehighlighter-subtle.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Subtle mouse highlighting
|
||||
type: Microsoft.PowerToys/MouseHighlighterSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
HighlightOpacity: 100
|
||||
HighlightRadius: 15
|
||||
HighlightFadeDelayMs: 300
|
||||
name: MouseHighlighter
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - High visibility for accessibility
|
||||
|
||||
This example configures high-contrast, long-lasting highlights.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
LeftButtonClickColor = "#FFFFFF"
|
||||
RightButtonClickColor = "#FF0000"
|
||||
HighlightOpacity = 255
|
||||
HighlightRadius = 40
|
||||
HighlightFadeDelayMs = 1500
|
||||
HighlightFadeDurationMs = 500
|
||||
}
|
||||
name = "MouseHighlighter"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module MouseHighlighter --input $config
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Presentations and demos
|
||||
|
||||
Configure for clear visibility during presentations:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Presentation highlighting
|
||||
type: Microsoft.PowerToys/MouseHighlighterSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LeftButtonClickColor: "#FFD700"
|
||||
HighlightOpacity: 200
|
||||
HighlightRadius: 25
|
||||
AutoActivate: true
|
||||
name: MouseHighlighter
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Screen recording
|
||||
|
||||
Configure for video tutorials and recordings:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Recording configuration
|
||||
type: Microsoft.PowerToys/MouseHighlighterSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
HighlightOpacity: 180
|
||||
HighlightFadeDelayMs: 600
|
||||
name: MouseHighlighter
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [MousePointerCrosshairs][03]
|
||||
- [PowerToys Mouse Utilities Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./MousePointerCrosshairs.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/mouse-utilities
|
||||
220
doc/dsc/modules/MouseJump.md
Normal file
220
doc/dsc/modules/MouseJump.md
Normal file
@@ -0,0 +1,220 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys MouseJump module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: MouseJump Module
|
||||
---
|
||||
|
||||
# MouseJump Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Mouse Jump utility, which enables quick
|
||||
navigation across large or multiple displays.
|
||||
|
||||
## Description
|
||||
|
||||
The `MouseJump` module configures PowerToys Mouse Jump, a utility that
|
||||
provides a miniature preview of all your displays, allowing you to quickly
|
||||
jump your mouse cursor to any location. This is particularly useful with
|
||||
large monitors or multi-monitor setups.
|
||||
|
||||
## Properties
|
||||
|
||||
The MouseJump module supports the following configurable properties:
|
||||
|
||||
### ActivationShortcut
|
||||
|
||||
Sets the keyboard shortcut to activate Mouse Jump.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Win+Shift+D`
|
||||
|
||||
### ThumbnailSize
|
||||
|
||||
Sets the size of the screen thumbnail preview.
|
||||
|
||||
**Type:** string
|
||||
**Allowed values:**
|
||||
|
||||
- `"small"` - Smaller thumbnail for faster performance
|
||||
- `"medium"` - Balanced size and performance
|
||||
- `"large"` - Larger thumbnail for better visibility
|
||||
|
||||
**Default:** `"medium"`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure activation shortcut with direct execution
|
||||
|
||||
This example customizes the Mouse Jump activation shortcut.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ActivationShortcut = @{
|
||||
win = $true
|
||||
ctrl = $false
|
||||
alt = $false
|
||||
shift = $true
|
||||
code = 68
|
||||
key = "D"
|
||||
}
|
||||
}
|
||||
name = "MouseJump"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module MouseJump `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure thumbnail size with DSC
|
||||
|
||||
This example sets a larger thumbnail for better visibility.
|
||||
|
||||
```bash
|
||||
dsc config set --file mousejump-size.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# mousejump-size.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Mouse Jump thumbnail
|
||||
type: Microsoft.PowerToys/MouseJumpSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailSize: large
|
||||
name: MouseJump
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Mouse Jump for multi-monitor
|
||||
setups.
|
||||
|
||||
```bash
|
||||
winget configure winget-mousejump.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-mousejump.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Mouse Jump
|
||||
type: Microsoft.PowerToys/MouseJumpSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailSize: medium
|
||||
name: MouseJump
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Performance-optimized configuration
|
||||
|
||||
This example uses a smaller thumbnail for better performance.
|
||||
|
||||
```bash
|
||||
dsc config set --file mousejump-performance.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# mousejump-performance.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Performance-optimized Mouse Jump
|
||||
type: Microsoft.PowerToys/MouseJumpSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailSize: small
|
||||
name: MouseJump
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Large display configuration
|
||||
|
||||
This example configures for large or high-DPI displays.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ThumbnailSize = "large"
|
||||
}
|
||||
name = "MouseJump"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module MouseJump --input $config
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Multi-monitor workstations
|
||||
|
||||
Configure for efficient navigation across multiple displays:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Multi-monitor configuration
|
||||
type: Microsoft.PowerToys/MouseJumpSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailSize: medium
|
||||
name: MouseJump
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Large displays
|
||||
|
||||
Configure for ultra-wide or 4K+ displays:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Large display configuration
|
||||
type: Microsoft.PowerToys/MouseJumpSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ThumbnailSize: large
|
||||
name: MouseJump
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [FindMyMouse][03]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./FindMyMouse.md
|
||||
290
doc/dsc/modules/MousePointerCrosshairs.md
Normal file
290
doc/dsc/modules/MousePointerCrosshairs.md
Normal file
@@ -0,0 +1,290 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys MousePointerCrosshairs module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: MousePointerCrosshairs Module
|
||||
---
|
||||
|
||||
# MousePointerCrosshairs Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Mouse Pointer Crosshairs utility, which
|
||||
displays crosshairs centered on your mouse pointer.
|
||||
|
||||
## Description
|
||||
|
||||
The `MousePointerCrosshairs` module configures PowerToys Mouse Pointer
|
||||
Crosshairs, a utility that displays customizable crosshairs overlaid on your
|
||||
screen, centered on the mouse cursor. This is useful for presentations,
|
||||
design work, or improving cursor visibility.
|
||||
|
||||
## Properties
|
||||
|
||||
The MousePointerCrosshairs module supports the following configurable properties:
|
||||
|
||||
### ActivationShortcut
|
||||
|
||||
Sets the keyboard shortcut to toggle crosshairs display.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Win+Alt+P`
|
||||
|
||||
### CrosshairsColor
|
||||
|
||||
Sets the color of the crosshairs.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Default:** `"#FF0000"` (red)
|
||||
|
||||
### CrosshairsOpacity
|
||||
|
||||
Sets the opacity of the crosshairs (0-100).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `100`
|
||||
**Default:** `75`
|
||||
|
||||
### CrosshairsRadius
|
||||
|
||||
Sets the length of the crosshair lines in pixels.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `9999`
|
||||
**Default:** `100`
|
||||
|
||||
### CrosshairsThickness
|
||||
|
||||
Sets the thickness of the crosshair lines in pixels.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `1` to `50`
|
||||
**Default:** `5`
|
||||
|
||||
### CrosshairsBorderColor
|
||||
|
||||
Sets the border color of the crosshairs.
|
||||
|
||||
**Type:** string (hex color)
|
||||
**Format:** `"#RRGGBB"`
|
||||
**Default:** `"#FFFFFF"` (white)
|
||||
|
||||
### CrosshairsBorderSize
|
||||
|
||||
Sets the width of the crosshair border in pixels.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `50`
|
||||
**Default:** `1`
|
||||
|
||||
### CrosshairsAutoHide
|
||||
|
||||
Controls whether crosshairs automatically hide when the mouse is not moving.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### CrosshairsIsFixedLengthEnabled
|
||||
|
||||
Controls whether crosshairs have a fixed length or extend to screen edges.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### CrosshairsFixedLength
|
||||
|
||||
Sets the fixed length of crosshairs when fixed length mode is enabled.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `9999`
|
||||
**Default:** `100`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure crosshair appearance with direct execution
|
||||
|
||||
This example customizes the crosshair color and size.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
CrosshairsColor = "#00FF00"
|
||||
CrosshairsOpacity = 85
|
||||
CrosshairsThickness = 3
|
||||
CrosshairsRadius = 150
|
||||
}
|
||||
name = "MousePointerCrosshairs"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module MousePointerCrosshairs `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure with border with DSC
|
||||
|
||||
This example adds a border to the crosshairs for better visibility.
|
||||
|
||||
```bash
|
||||
dsc config set --file mousecrosshairs-border.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# mousecrosshairs-border.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure crosshairs with border
|
||||
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CrosshairsColor: "#FF0000"
|
||||
CrosshairsBorderColor: "#FFFFFF"
|
||||
CrosshairsBorderSize: 2
|
||||
CrosshairsThickness: 4
|
||||
name: MousePointerCrosshairs
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures crosshairs for presentations.
|
||||
|
||||
```bash
|
||||
winget configure winget-mousecrosshairs.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-mousecrosshairs.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Mouse Crosshairs
|
||||
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CrosshairsColor: "#FFFF00"
|
||||
CrosshairsOpacity: 90
|
||||
CrosshairsRadius: 120
|
||||
CrosshairsThickness: 5
|
||||
CrosshairsBorderSize: 2
|
||||
name: MousePointerCrosshairs
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Full-screen crosshairs
|
||||
|
||||
This example configures crosshairs that extend to screen edges.
|
||||
|
||||
```bash
|
||||
dsc config set --file mousecrosshairs-fullscreen.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# mousecrosshairs-fullscreen.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Full-screen crosshairs
|
||||
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CrosshairsIsFixedLengthEnabled: false
|
||||
CrosshairsOpacity: 60
|
||||
name: MousePointerCrosshairs
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Subtle crosshairs with auto-hide
|
||||
|
||||
This example creates subtle crosshairs that hide when idle.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
CrosshairsColor = "#FFFFFF"
|
||||
CrosshairsOpacity = 50
|
||||
CrosshairsThickness = 2
|
||||
CrosshairsRadius = 80
|
||||
CrosshairsAutoHide = $true
|
||||
}
|
||||
name = "MousePointerCrosshairs"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module MousePointerCrosshairs --input $config
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Presentations and demos
|
||||
|
||||
Configure for clear cursor tracking during presentations:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Presentation crosshairs
|
||||
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CrosshairsColor: "#FFFF00"
|
||||
CrosshairsOpacity: 85
|
||||
CrosshairsRadius: 150
|
||||
name: MousePointerCrosshairs
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Design and alignment
|
||||
|
||||
Configure for precise alignment work:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Design crosshairs
|
||||
type: Microsoft.PowerToys/MousePointerCrosshairsSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CrosshairsIsFixedLengthEnabled: false
|
||||
CrosshairsThickness: 1
|
||||
CrosshairsOpacity: 70
|
||||
name: MousePointerCrosshairs
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [MouseHighlighter][03]
|
||||
- [PowerToys Mouse Utilities Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./MouseHighlighter.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/mouse-utilities
|
||||
200
doc/dsc/modules/Peek.md
Normal file
200
doc/dsc/modules/Peek.md
Normal file
@@ -0,0 +1,200 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys Peek module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: Peek Module
|
||||
---
|
||||
|
||||
# Peek Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Peek utility, a quick file preview tool.
|
||||
|
||||
## Description
|
||||
|
||||
The `Peek` module configures PowerToys Peek, a utility that provides quick
|
||||
file previews without opening files. Activate it with a keyboard shortcut to
|
||||
preview documents, images, videos, and more in a popup window.
|
||||
|
||||
## Properties
|
||||
|
||||
The Peek module supports the following configurable properties:
|
||||
|
||||
### ActivationShortcut
|
||||
|
||||
Sets the keyboard shortcut to activate Peek for the selected file.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Ctrl+Space`
|
||||
|
||||
### CloseAfterLosingFocus
|
||||
|
||||
Controls whether Peek window closes when it loses focus.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure activation shortcut with direct execution
|
||||
|
||||
This example customizes the Peek activation shortcut.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ActivationShortcut = @{
|
||||
win = $false
|
||||
ctrl = $true
|
||||
alt = $false
|
||||
shift = $false
|
||||
code = 32
|
||||
key = "Space"
|
||||
}
|
||||
}
|
||||
name = "Peek"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Peek --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure focus behavior with DSC
|
||||
|
||||
This example configures Peek to remain open after losing focus.
|
||||
|
||||
```bash
|
||||
dsc config set --file peek-focus.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# peek-focus.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Peek focus behavior
|
||||
type: Microsoft.PowerToys/PeekSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CloseAfterLosingFocus: false
|
||||
name: Peek
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Peek.
|
||||
|
||||
```bash
|
||||
winget configure winget-peek.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-peek.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Peek
|
||||
type: Microsoft.PowerToys/PeekSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CloseAfterLosingFocus: true
|
||||
name: Peek
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Alternative activation shortcut
|
||||
|
||||
This example uses Ctrl+Shift+Space as the activation shortcut.
|
||||
|
||||
```bash
|
||||
dsc config set --file peek-altkey.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# peek-altkey.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Alternative Peek shortcut
|
||||
type: Microsoft.PowerToys/PeekSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ActivationShortcut:
|
||||
win: false
|
||||
ctrl: true
|
||||
alt: false
|
||||
shift: true
|
||||
code: 32
|
||||
key: Space
|
||||
name: Peek
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### File browsing
|
||||
|
||||
Configure for quick file preview during browsing:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: File browsing configuration
|
||||
type: Microsoft.PowerToys/PeekSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CloseAfterLosingFocus: true
|
||||
name: Peek
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Content review
|
||||
|
||||
Configure for extended content review:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Review configuration
|
||||
type: Microsoft.PowerToys/PeekSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
CloseAfterLosingFocus: false
|
||||
name: Peek
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [ShortcutGuide][03]
|
||||
- [PowerToys Peek Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./ShortcutGuide.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/peek
|
||||
257
doc/dsc/modules/PowerAccent.md
Normal file
257
doc/dsc/modules/PowerAccent.md
Normal file
@@ -0,0 +1,257 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys PowerAccent module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: PowerAccent Module
|
||||
---
|
||||
|
||||
# PowerAccent Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Power Accent utility, a quick accent character selector.
|
||||
|
||||
## Description
|
||||
|
||||
The `PowerAccent` module configures PowerToys Power Accent (Quick Accent), a
|
||||
utility that provides quick access to accented characters. Hold down a key
|
||||
and use arrow keys or numbers to select from available accent variations.
|
||||
|
||||
## Properties
|
||||
|
||||
The PowerAccent module supports the following configurable properties:
|
||||
|
||||
### ActivationKey
|
||||
|
||||
Sets which key triggers the accent selection.
|
||||
|
||||
**Type:** string
|
||||
**Allowed values:**
|
||||
|
||||
- `"LeftRightArrow"` - Hold left or right arrow keys
|
||||
- `"Space"` - Hold spacebar
|
||||
- `"Both"` - Hold either left/right arrows or spacebar
|
||||
|
||||
**Default:** `"Both"`
|
||||
|
||||
### InputTime
|
||||
|
||||
Sets how long the activation key must be held (in milliseconds) before showing accents.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `100` to `1000`
|
||||
**Default:** `300`
|
||||
|
||||
### ExcludedApps
|
||||
|
||||
List of applications where Power Accent is disabled.
|
||||
|
||||
**Type:** string (newline-separated list of executable names)
|
||||
|
||||
### ToolbarPosition
|
||||
|
||||
Sets the position of the accent selection toolbar.
|
||||
|
||||
**Type:** string
|
||||
**Allowed values:**
|
||||
|
||||
- `"Top"` - Above the cursor
|
||||
- `"Bottom"` - Below the cursor
|
||||
- `"Left"` - To the left of cursor
|
||||
- `"Right"` - To the right of cursor
|
||||
- `"Center"` - Centered on screen
|
||||
|
||||
**Default:** `"Top"`
|
||||
|
||||
### ShowUnicodeDescription
|
||||
|
||||
Controls whether Unicode descriptions are shown for each accent character.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### SortByUsageFrequency
|
||||
|
||||
Controls whether accent characters are sorted by usage frequency.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### StartSelectionFromTheLeft
|
||||
|
||||
Controls whether selection starts from the left side.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure activation method with direct execution
|
||||
|
||||
This example sets spacebar as the activation key.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ActivationKey = "Space"
|
||||
InputTime = 250
|
||||
}
|
||||
name = "PowerAccent"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module PowerAccent `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure toolbar appearance with DSC
|
||||
|
||||
This example customizes the toolbar position and display options.
|
||||
|
||||
```bash
|
||||
dsc config set --file poweraccent-toolbar.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# poweraccent-toolbar.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Power Accent toolbar
|
||||
type: Microsoft.PowerToys/PowerAccentSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ToolbarPosition: Bottom
|
||||
ShowUnicodeDescription: true
|
||||
SortByUsageFrequency: true
|
||||
name: PowerAccent
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Power Accent for multilingual
|
||||
typing.
|
||||
|
||||
```bash
|
||||
winget configure winget-poweraccent.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-poweraccent.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Power Accent
|
||||
type: Microsoft.PowerToys/PowerAccentSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ActivationKey: Space
|
||||
InputTime: 300
|
||||
ToolbarPosition: Top
|
||||
SortByUsageFrequency: true
|
||||
name: PowerAccent
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Fast activation configuration
|
||||
|
||||
This example configures for quick accent selection.
|
||||
|
||||
```bash
|
||||
dsc config set --file poweraccent-fast.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# poweraccent-fast.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Fast accent activation
|
||||
type: Microsoft.PowerToys/PowerAccentSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
InputTime: 150
|
||||
SortByUsageFrequency: true
|
||||
name: PowerAccent
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Exclude applications
|
||||
|
||||
This example excludes specific applications from Power Accent.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ExcludedApps = "notepad.exe`nWordPad.exe"
|
||||
}
|
||||
name = "PowerAccent"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module PowerAccent --input $config
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Multilingual content creation
|
||||
|
||||
Configure for efficient multilingual typing:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Multilingual configuration
|
||||
type: Microsoft.PowerToys/PowerAccentSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ActivationKey: Space
|
||||
SortByUsageFrequency: true
|
||||
ShowUnicodeDescription: false
|
||||
name: PowerAccent
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Language learning
|
||||
|
||||
Configure for language learning with Unicode descriptions:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Learning configuration
|
||||
type: Microsoft.PowerToys/PowerAccentSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ShowUnicodeDescription: true
|
||||
InputTime: 400
|
||||
name: PowerAccent
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [Workspaces][03]
|
||||
- [PowerToys Quick Accent Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./Workspaces.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/quick-accent
|
||||
197
doc/dsc/modules/PowerOCR.md
Normal file
197
doc/dsc/modules/PowerOCR.md
Normal file
@@ -0,0 +1,197 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys PowerOCR module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: PowerOCR Module
|
||||
---
|
||||
|
||||
# PowerOCR Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Power OCR (Text Extractor) utility, which
|
||||
extracts text from images and screen regions.
|
||||
|
||||
## Description
|
||||
|
||||
The `PowerOCR` module configures PowerToys Power OCR (Text Extractor), a
|
||||
utility that uses optical character recognition (OCR) to extract text from
|
||||
any screen region and copy it to the clipboard. It's useful for capturing
|
||||
text from images, videos, PDFs, or any on-screen content.
|
||||
|
||||
## Properties
|
||||
|
||||
The PowerOCR module supports the following configurable properties:
|
||||
|
||||
### ActivationShortcut
|
||||
|
||||
Sets the keyboard shortcut to activate text extraction.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Win+Shift+T`
|
||||
|
||||
### PreferredLanguage
|
||||
|
||||
Sets the preferred language for OCR recognition.
|
||||
|
||||
**Type:** string
|
||||
**Default:** System language
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure activation shortcut with direct execution
|
||||
|
||||
This example customizes the OCR activation shortcut.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ActivationShortcut = @{
|
||||
win = $true
|
||||
ctrl = $false
|
||||
alt = $false
|
||||
shift = $true
|
||||
code = 84
|
||||
key = "T"
|
||||
}
|
||||
}
|
||||
name = "PowerOCR"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module PowerOCR `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure language with DSC
|
||||
|
||||
This example sets the preferred OCR language.
|
||||
|
||||
```bash
|
||||
dsc config set --file powerocr-language.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# powerocr-language.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Power OCR language
|
||||
type: Microsoft.PowerToys/PowerOCRSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PreferredLanguage: en-US
|
||||
name: PowerOCR
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Power OCR.
|
||||
|
||||
```bash
|
||||
winget configure winget-powerocr.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-powerocr.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Power OCR
|
||||
type: Microsoft.PowerToys/PowerOCRSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PreferredLanguage: en-US
|
||||
name: PowerOCR
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Multilingual configuration
|
||||
|
||||
This example configures for multilingual text extraction.
|
||||
|
||||
```bash
|
||||
dsc config set --file powerocr-multilingual.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# powerocr-multilingual.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Multilingual OCR
|
||||
type: Microsoft.PowerToys/PowerOCRSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PreferredLanguage: fr-FR
|
||||
name: PowerOCR
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Document digitization
|
||||
|
||||
Configure for extracting text from documents:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Document OCR
|
||||
type: Microsoft.PowerToys/PowerOCRSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PreferredLanguage: en-US
|
||||
name: PowerOCR
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### International content
|
||||
|
||||
Configure for multilingual content extraction:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Multilingual OCR
|
||||
type: Microsoft.PowerToys/PowerOCRSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PreferredLanguage: es-ES
|
||||
name: PowerOCR
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [ZoomIt][03]
|
||||
- [PowerToys Text Extractor Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./ZoomIt.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/text-extractor
|
||||
230
doc/dsc/modules/PowerRename.md
Normal file
230
doc/dsc/modules/PowerRename.md
Normal file
@@ -0,0 +1,230 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys PowerRename module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: PowerRename Module
|
||||
---
|
||||
|
||||
# PowerRename Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Power Rename utility, a bulk file and folder renaming tool.
|
||||
|
||||
## Description
|
||||
|
||||
The `PowerRename` module configures PowerToys Power Rename, a Windows shell
|
||||
extension that enables bulk renaming of files and folders with advanced
|
||||
features like regular expressions, preview, and undo functionality. It
|
||||
integrates with the Windows Explorer context menu.
|
||||
|
||||
## Properties
|
||||
|
||||
The PowerRename module supports the following configurable properties:
|
||||
|
||||
### MRUEnabled
|
||||
|
||||
Controls whether the most recently used (MRU) search and replace terms are saved.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### MaxMRUSize
|
||||
|
||||
Sets the maximum number of MRU entries to remember.
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `20`
|
||||
**Default:** `10`
|
||||
|
||||
### ShowIcon
|
||||
|
||||
Controls whether the Power Rename icon appears in the Explorer context menu.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `true`
|
||||
|
||||
### ExtendedContextMenuOnly
|
||||
|
||||
Controls whether Power Rename appears only in the extended context menu (Shift+right-click).
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### UseBoostLib
|
||||
|
||||
Controls whether the Boost library is used for regular expression processing.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure MRU settings with direct execution
|
||||
|
||||
This example configures the most recently used list behavior.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
MRUEnabled = $true
|
||||
MaxMRUSize = 15
|
||||
}
|
||||
name = "PowerRename"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module PowerRename --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure context menu with DSC
|
||||
|
||||
This example configures Power Rename to appear in the extended context menu
|
||||
only.
|
||||
|
||||
```bash
|
||||
dsc config set --file powerrename-context.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# powerrename-context.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Power Rename context menu
|
||||
type: Microsoft.PowerToys/PowerRenameSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExtendedContextMenuOnly: true
|
||||
ShowIcon: true
|
||||
name: PowerRename
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Power Rename.
|
||||
|
||||
```bash
|
||||
winget configure winget-powerrename.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-powerrename.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Power Rename
|
||||
type: Microsoft.PowerToys/PowerRenameSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
MRUEnabled: true
|
||||
MaxMRUSize: 20
|
||||
ShowIcon: true
|
||||
UseBoostLib: true
|
||||
name: PowerRename
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Clean context menu configuration
|
||||
|
||||
This example minimizes context menu clutter.
|
||||
|
||||
```bash
|
||||
dsc config set --file powerrename-minimal.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# powerrename-minimal.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Minimal context menu
|
||||
type: Microsoft.PowerToys/PowerRenameSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExtendedContextMenuOnly: true
|
||||
ShowIcon: false
|
||||
name: PowerRename
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Advanced regex configuration
|
||||
|
||||
This example enables the Boost library for advanced regex features.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
UseBoostLib = $true
|
||||
MRUEnabled = $true
|
||||
MaxMRUSize = 15
|
||||
}
|
||||
name = "PowerRename"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module PowerRename --input $config
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Content management
|
||||
|
||||
Configure for frequent file renaming tasks:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Content management
|
||||
type: Microsoft.PowerToys/PowerRenameSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
MRUEnabled: true
|
||||
MaxMRUSize: 20
|
||||
ShowIcon: true
|
||||
name: PowerRename
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Clean interface
|
||||
|
||||
Configure for minimal context menu presence:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Clean interface
|
||||
type: Microsoft.PowerToys/PowerRenameSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExtendedContextMenuOnly: true
|
||||
name: PowerRename
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [AdvancedPaste][03]
|
||||
- [PowerToys PowerRename Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./AdvancedPaste.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/powerrename
|
||||
173
doc/dsc/modules/RegistryPreview.md
Normal file
173
doc/dsc/modules/RegistryPreview.md
Normal file
@@ -0,0 +1,173 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys RegistryPreview module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: RegistryPreview Module
|
||||
---
|
||||
|
||||
# RegistryPreview Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Registry Preview utility, which visualizes and edits Windows registry files (.reg).
|
||||
|
||||
## Description
|
||||
|
||||
The `RegistryPreview` module configures PowerToys Registry Preview, a utility
|
||||
that provides a visual preview and editing interface for Windows registry
|
||||
(.reg) files. It helps you understand and safely edit registry files before
|
||||
applying them to your system.
|
||||
|
||||
## Properties
|
||||
|
||||
The RegistryPreview module supports the following configurable properties:
|
||||
|
||||
### DefaultRegApp
|
||||
|
||||
Controls whether Registry Preview is set as the default application for .reg files.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Set as default .reg handler with direct execution
|
||||
|
||||
This example sets Registry Preview as the default application for .reg files.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
DefaultRegApp = $true
|
||||
}
|
||||
name = "RegistryPreview"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module RegistryPreview --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure with DSC
|
||||
|
||||
This example configures Registry Preview as the default handler.
|
||||
|
||||
```bash
|
||||
dsc config set --file registrypreview-default.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# registrypreview-default.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Set Registry Preview as default
|
||||
type: Microsoft.PowerToys/RegistryPreviewSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
DefaultRegApp: true
|
||||
name: RegistryPreview
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and sets Registry Preview as the default .reg
|
||||
handler.
|
||||
|
||||
```bash
|
||||
winget configure winget-registrypreview.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-registrypreview.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Registry Preview
|
||||
type: Microsoft.PowerToys/RegistryPreviewSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
DefaultRegApp: true
|
||||
name: RegistryPreview
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Disable as default handler
|
||||
|
||||
This example ensures Registry Preview is not the default .reg handler.
|
||||
|
||||
```bash
|
||||
dsc config set --file registrypreview-notdefault.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# registrypreview-notdefault.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Do not use as default
|
||||
type: Microsoft.PowerToys/RegistryPreviewSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
DefaultRegApp: false
|
||||
name: RegistryPreview
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### System administration
|
||||
|
||||
Configure as default for safe registry file handling:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Admin configuration
|
||||
type: Microsoft.PowerToys/RegistryPreviewSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
DefaultRegApp: true
|
||||
name: RegistryPreview
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Optional tool
|
||||
|
||||
Keep as optional tool without default file association:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Optional tool
|
||||
type: Microsoft.PowerToys/RegistryPreviewSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
DefaultRegApp: false
|
||||
name: RegistryPreview
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [FileLocksmith][03]
|
||||
- [PowerToys Registry Preview Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./FileLocksmith.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/registry-preview
|
||||
259
doc/dsc/modules/ShortcutGuide.md
Normal file
259
doc/dsc/modules/ShortcutGuide.md
Normal file
@@ -0,0 +1,259 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys ShortcutGuide module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: ShortcutGuide Module
|
||||
---
|
||||
|
||||
# ShortcutGuide Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Shortcut Guide utility, which displays available keyboard shortcuts.
|
||||
|
||||
## Description
|
||||
|
||||
The `ShortcutGuide` module configures PowerToys Shortcut Guide, a utility that
|
||||
displays an overlay showing available Windows keyboard shortcuts when you hold
|
||||
the Windows key. It helps users discover and learn keyboard shortcuts.
|
||||
|
||||
## Properties
|
||||
|
||||
The ShortcutGuide module supports the following configurable properties:
|
||||
|
||||
### OpenShortcutGuide
|
||||
|
||||
Sets the keyboard shortcut or method to open the shortcut guide.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** Hold Windows key for 900ms
|
||||
|
||||
### OverlayOpacity
|
||||
|
||||
Sets the opacity of the shortcut guide overlay (0-100).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `0` to `100`
|
||||
**Default:** `90`
|
||||
|
||||
### Theme
|
||||
|
||||
Sets the theme for the shortcut guide.
|
||||
|
||||
**Type:** string
|
||||
**Allowed values:** `"light"`, `"dark"`, `"system"`
|
||||
**Default:** `"dark"`
|
||||
|
||||
### PressTime
|
||||
|
||||
Sets how long the Windows key must be held before showing the guide (in milliseconds).
|
||||
|
||||
**Type:** integer
|
||||
**Range:** `100` to `10000`
|
||||
**Default:** `900`
|
||||
|
||||
### ExcludedApps
|
||||
|
||||
List of applications where Shortcut Guide is disabled.
|
||||
|
||||
**Type:** string (newline-separated list of executable names)
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure activation time with direct execution
|
||||
|
||||
This example sets a faster activation time for the shortcut guide.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
PressTime = 600
|
||||
}
|
||||
name = "ShortcutGuide"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module ShortcutGuide `
|
||||
--input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure appearance with DSC
|
||||
|
||||
This example customizes the overlay appearance.
|
||||
|
||||
```bash
|
||||
dsc config set --file shortcutguide-appearance.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# shortcutguide-appearance.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Shortcut Guide appearance
|
||||
type: Microsoft.PowerToys/ShortcutGuideSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
OverlayOpacity: 95
|
||||
Theme: light
|
||||
name: ShortcutGuide
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Shortcut Guide.
|
||||
|
||||
```bash
|
||||
winget configure winget-shortcutguide.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-shortcutguide.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Shortcut Guide
|
||||
type: Microsoft.PowerToys/ShortcutGuideSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PressTime: 700
|
||||
OverlayOpacity: 90
|
||||
Theme: dark
|
||||
name: ShortcutGuide
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Quick activation
|
||||
|
||||
This example configures for quick activation with a short press time.
|
||||
|
||||
```bash
|
||||
dsc config set --file shortcutguide-quick.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# shortcutguide-quick.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Quick activation
|
||||
type: Microsoft.PowerToys/ShortcutGuideSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PressTime: 400
|
||||
name: ShortcutGuide
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - High opacity for visibility
|
||||
|
||||
This example maximizes opacity for better visibility.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
OverlayOpacity = 100
|
||||
Theme = "dark"
|
||||
}
|
||||
name = "ShortcutGuide"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module ShortcutGuide --input $config
|
||||
```
|
||||
|
||||
### Example 6 - Exclude applications
|
||||
|
||||
This example excludes Shortcut Guide from specific applications.
|
||||
|
||||
```bash
|
||||
dsc config set --file shortcutguide-exclusions.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# shortcutguide-exclusions.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Exclude apps
|
||||
type: Microsoft.PowerToys/ShortcutGuideSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ExcludedApps: |
|
||||
Game.exe
|
||||
FullScreenApp.exe
|
||||
name: ShortcutGuide
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### New users
|
||||
|
||||
Configure for easy keyboard shortcut discovery:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: New user configuration
|
||||
type: Microsoft.PowerToys/ShortcutGuideSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PressTime: 800
|
||||
OverlayOpacity: 95
|
||||
name: ShortcutGuide
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Power users
|
||||
|
||||
Configure for quick access without accidental activation:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Power user configuration
|
||||
type: Microsoft.PowerToys/ShortcutGuideSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
PressTime: 1200
|
||||
OverlayOpacity: 85
|
||||
name: ShortcutGuide
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [Peek][03]
|
||||
- [PowerToys Keyboard Shortcut Guide Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./Peek.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/shortcut-guide
|
||||
238
doc/dsc/modules/Workspaces.md
Normal file
238
doc/dsc/modules/Workspaces.md
Normal file
@@ -0,0 +1,238 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys Workspaces module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: Workspaces Module
|
||||
---
|
||||
|
||||
# Workspaces Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the Workspaces utility, which launches application sets and arranges windows.
|
||||
|
||||
## Description
|
||||
|
||||
The `Workspaces` module configures PowerToys Workspaces, a utility that allows
|
||||
you to save and restore sets of applications with their window positions. It
|
||||
enables you to quickly switch between different work contexts by launching and
|
||||
arranging multiple applications at once.
|
||||
|
||||
## Properties
|
||||
|
||||
The Workspaces module supports the following configurable properties:
|
||||
|
||||
### LaunchHotkey
|
||||
|
||||
Sets the keyboard shortcut to launch the Workspaces editor.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Win+Shift+;` (VK code 186)
|
||||
|
||||
### MoveExistingWindows
|
||||
|
||||
Controls whether existing application windows are moved when launching a workspace.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
### SpanZonesAcrossMonitors
|
||||
|
||||
Controls whether workspace zones can span across multiple monitors.
|
||||
|
||||
**Type:** boolean
|
||||
**Default:** `false`
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure launch hotkey with direct execution
|
||||
|
||||
This example sets a custom hotkey to launch the Workspaces editor.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
LaunchHotkey = @{
|
||||
win = $true
|
||||
ctrl = $true
|
||||
alt = $false
|
||||
shift = $false
|
||||
code = 87
|
||||
key = "W"
|
||||
}
|
||||
}
|
||||
name = "Workspaces"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Workspaces --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure window behavior with DSC
|
||||
|
||||
This example enables moving existing windows when launching workspaces.
|
||||
|
||||
```bash
|
||||
dsc config set --file workspaces-behavior.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# workspaces-behavior.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Workspaces window behavior
|
||||
type: Microsoft.PowerToys/WorkspacesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
MoveExistingWindows: true
|
||||
SpanZonesAcrossMonitors: false
|
||||
name: Workspaces
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures Workspaces.
|
||||
|
||||
```bash
|
||||
winget configure winget-workspaces.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-workspaces.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure Workspaces
|
||||
type: Microsoft.PowerToys/WorkspacesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
LaunchHotkey:
|
||||
win: true
|
||||
ctrl: false
|
||||
alt: false
|
||||
shift: true
|
||||
code: 186
|
||||
key: ";"
|
||||
MoveExistingWindows: true
|
||||
name: Workspaces
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Multi-monitor setup
|
||||
|
||||
This example configures for multi-monitor workspace management.
|
||||
|
||||
```bash
|
||||
dsc config set --file workspaces-multimonitor.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# workspaces-multimonitor.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Multi-monitor configuration
|
||||
type: Microsoft.PowerToys/WorkspacesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
SpanZonesAcrossMonitors: true
|
||||
MoveExistingWindows: true
|
||||
name: Workspaces
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 5 - Simple hotkey
|
||||
|
||||
This example sets a simple single-key hotkey combination.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
LaunchHotkey = @{
|
||||
win = $true
|
||||
ctrl = $false
|
||||
alt = $true
|
||||
shift = $false
|
||||
code = 192
|
||||
key = "~"
|
||||
}
|
||||
}
|
||||
name = "Workspaces"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Workspaces --input $config
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Development environments
|
||||
|
||||
Configure for quick switching between development workspaces:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Development workspace
|
||||
type: Microsoft.PowerToys/WorkspacesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
MoveExistingWindows: true
|
||||
SpanZonesAcrossMonitors: true
|
||||
name: Workspaces
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Single monitor usage
|
||||
|
||||
Configure for single-monitor workflow:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Single monitor setup
|
||||
type: Microsoft.PowerToys/WorkspacesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
SpanZonesAcrossMonitors: false
|
||||
MoveExistingWindows: false
|
||||
name: Workspaces
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [ColorPicker Module][03] - For additional PowerToys configuration
|
||||
- [PowerToys Workspaces Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./ColorPicker.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/workspaces
|
||||
215
doc/dsc/modules/ZoomIt.md
Normal file
215
doc/dsc/modules/ZoomIt.md
Normal file
@@ -0,0 +1,215 @@
|
||||
---
|
||||
description: DSC configuration reference for PowerToys ZoomIt module
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: ZoomIt Module
|
||||
---
|
||||
|
||||
# ZoomIt Module
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration for the ZoomIt utility, which provides screen zoom, annotation, and presentation tools.
|
||||
|
||||
## Description
|
||||
|
||||
The `ZoomIt` module configures PowerToys ZoomIt, a screen zoom and annotation utility for presentations and demonstrations. It provides live zoom, screen drawing, a break timer, and other presentation features activated through customizable keyboard shortcuts.
|
||||
|
||||
## Properties
|
||||
|
||||
The ZoomIt module supports the following configurable properties:
|
||||
|
||||
### ActivationShortcut
|
||||
|
||||
Sets the keyboard shortcut to activate the zoom mode.
|
||||
|
||||
**Type:** object
|
||||
**Properties:**
|
||||
|
||||
- `win` (boolean) - Windows key modifier
|
||||
- `ctrl` (boolean) - Ctrl key modifier
|
||||
- `alt` (boolean) - Alt key modifier
|
||||
- `shift` (boolean) - Shift key modifier
|
||||
- `code` (integer) - Virtual key code
|
||||
- `key` (string) - Key name
|
||||
|
||||
**Default:** `Ctrl+1` (VK code 49)
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Configure activation shortcut with direct execution
|
||||
|
||||
This example sets a custom keyboard shortcut to activate ZoomIt.
|
||||
|
||||
```powershell
|
||||
$config = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
ActivationShortcut = @{
|
||||
win = $false
|
||||
ctrl = $true
|
||||
alt = $false
|
||||
shift = $true
|
||||
code = 90
|
||||
key = "Z"
|
||||
}
|
||||
}
|
||||
name = "ZoomIt"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
PowerToys.DSC.exe set --resource 'settings' --module ZoomIt --input $config
|
||||
```
|
||||
|
||||
### Example 2 - Configure with Microsoft DSC
|
||||
|
||||
This example configures the ZoomIt activation shortcut using Microsoft DSC.
|
||||
|
||||
```bash
|
||||
dsc config set --file zoomit-config.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# zoomit-config.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure ZoomIt shortcut
|
||||
type: Microsoft.PowerToys/ZoomItSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ActivationShortcut:
|
||||
win: false
|
||||
ctrl: true
|
||||
alt: false
|
||||
shift: false
|
||||
code: 49
|
||||
key: "1"
|
||||
name: ZoomIt
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and configures ZoomIt using WinGet.
|
||||
|
||||
```bash
|
||||
winget configure winget-zoomit.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# winget-zoomit.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure ZoomIt
|
||||
type: Microsoft.PowerToys/ZoomItSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ActivationShortcut:
|
||||
win: false
|
||||
ctrl: true
|
||||
alt: false
|
||||
shift: true
|
||||
code: 90
|
||||
key: Z
|
||||
name: ZoomIt
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 4 - Presentation mode hotkey
|
||||
|
||||
This example configures an easy-to-remember presentation hotkey.
|
||||
|
||||
```bash
|
||||
dsc config set --file zoomit-presentation.dsc.yaml
|
||||
```
|
||||
|
||||
```yaml
|
||||
# zoomit-presentation.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Presentation hotkey
|
||||
type: Microsoft.PowerToys/ZoomItSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ActivationShortcut:
|
||||
win: true
|
||||
ctrl: false
|
||||
alt: false
|
||||
shift: false
|
||||
code: 187
|
||||
key: "="
|
||||
name: ZoomIt
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Use cases
|
||||
|
||||
### Presentations
|
||||
|
||||
Configure for easy screen zooming during presentations:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Presentation setup
|
||||
type: Microsoft.PowerToys/ZoomItSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ActivationShortcut:
|
||||
win: false
|
||||
ctrl: true
|
||||
alt: false
|
||||
shift: false
|
||||
code: 49
|
||||
key: "1"
|
||||
name: ZoomIt
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Screen recording
|
||||
|
||||
Configure for quick access during screen recording sessions:
|
||||
|
||||
```yaml
|
||||
resources:
|
||||
- name: Recording setup
|
||||
type: Microsoft.PowerToys/ZoomItSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ActivationShortcut:
|
||||
win: true
|
||||
ctrl: false
|
||||
alt: false
|
||||
shift: true
|
||||
code: 90
|
||||
key: Z
|
||||
name: ZoomIt
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource][01]
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [CropAndLock Module][03] - For additional PowerToys configuration
|
||||
- [PowerToys ZoomIt Documentation][04]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ../settings-resource.md
|
||||
[02]: ../overview.md
|
||||
[03]: ./CropAndLock.md
|
||||
[04]: https://learn.microsoft.com/windows/powertoys/zoomit
|
||||
244
doc/dsc/overview.md
Normal file
244
doc/dsc/overview.md
Normal file
@@ -0,0 +1,244 @@
|
||||
---
|
||||
description: Overview of PowerToys Desired State Configuration (DSC) support
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: overview
|
||||
title: PowerToys DSC Overview
|
||||
---
|
||||
|
||||
# PowerToys DSC Overview
|
||||
|
||||
## Synopsis
|
||||
|
||||
PowerToys supports Desired State Configuration (DSC) v3 for declarative configuration management of PowerToys settings.
|
||||
|
||||
## Description
|
||||
|
||||
PowerToys includes Microsoft Desired State Configuration (DSC) support
|
||||
through the `PowerToys.DSC.exe` command-line tool, enabling you to:
|
||||
|
||||
- Declare and enforce desired configuration states for PowerToys
|
||||
utilities.
|
||||
- Automate PowerToys configuration across multiple systems.
|
||||
- Integrate PowerToys configuration with WinGet and other DSC-compatible
|
||||
tools.
|
||||
- Version control your PowerToys settings as code.
|
||||
|
||||
The PowerToys DSC implementation provides a **settings** resource that
|
||||
manages configuration for all PowerToys utilities (modules). Each utility
|
||||
can be configured independently, allowing granular control over your
|
||||
PowerToys environment.
|
||||
|
||||
## Usage methods
|
||||
|
||||
PowerToys DSC can be used in three ways:
|
||||
|
||||
### 1. Direct execution with PowerToys.DSC.exe
|
||||
|
||||
Execute DSC operations directly using the PowerToys.DSC.exe command-line
|
||||
tool:
|
||||
|
||||
```powershell
|
||||
# Get current settings for a module
|
||||
PowerToys.DSC.exe get --resource 'settings' --module Awake
|
||||
|
||||
# Set settings for a module
|
||||
$input = '{"settings":{...}}'
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Awake --input $input
|
||||
|
||||
# Test if settings match desired state
|
||||
PowerToys.DSC.exe test --resource 'settings' --module Awake --input $input
|
||||
```
|
||||
|
||||
For detailed information, see [PowerToys.DSC.exe command reference][01].
|
||||
|
||||
### 2. Microsoft Desired State Configuration (DSC)
|
||||
|
||||
Use PowerToys DSC resources in standard DSC configuration documents:
|
||||
|
||||
```yaml
|
||||
# powertoys-config.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Awake
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
keepDisplayOn: true
|
||||
mode: 1
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
### 3. WinGet Configuration
|
||||
|
||||
Integrate PowerToys configuration with WinGet package installation:
|
||||
|
||||
```yaml
|
||||
# winget-powertoys.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure FancyZones
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_shiftDrag: true
|
||||
fancyzones_mouseSwitch: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
## Available resources
|
||||
|
||||
PowerToys DSC provides the following resource:
|
||||
|
||||
| Resource | Description |
|
||||
| ---------- | ---------------------------------------------------- |
|
||||
| `settings` | Manages configuration for PowerToys utility modules. |
|
||||
|
||||
For detailed information about the settings resource, see [Settings
|
||||
Resource Reference][03].
|
||||
|
||||
## Available modules
|
||||
|
||||
The settings resource supports configuration for the following PowerToys
|
||||
utilities:
|
||||
|
||||
| Module | Description | Documentation |
|
||||
| ---------------------- | -------------------------------------------- | ------------------------------------- |
|
||||
| App | General PowerToys application settings. | [App module][04] |
|
||||
| AdvancedPaste | Advanced clipboard operations. | [AdvancedPaste module][05] |
|
||||
| AlwaysOnTop | Pin windows to stay on top. | [AlwaysOnTop module][06] |
|
||||
| Awake | Keep computer awake. | [Awake module][07] |
|
||||
| ColorPicker | System-wide color picker utility. | [ColorPicker module][08] |
|
||||
| CropAndLock | Crop and lock portions of windows. | [CropAndLock module][09] |
|
||||
| EnvironmentVariables | Manage environment variables. | [EnvironmentVariables module][10] |
|
||||
| FancyZones | Window layout manager. | [FancyZones module][11] |
|
||||
| FileLocksmith | Identify what's locking files. | [FileLocksmith module][12] |
|
||||
| FindMyMouse | Locate your mouse cursor. | [FindMyMouse module][13] |
|
||||
| Hosts | Quick hosts file editor. | [Hosts module][14] |
|
||||
| ImageResizer | Resize images from context menu. | [ImageResizer module][15] |
|
||||
| KeyboardManager | Remap keys and create shortcuts. | [KeyboardManager module][16] |
|
||||
| MeasureTool | Measure pixels on screen. | [MeasureTool module][17] |
|
||||
| MouseHighlighter | Highlight mouse cursor. | [MouseHighlighter module][18] |
|
||||
| MouseJump | Jump across large or multiple displays. | [MouseJump module][19] |
|
||||
| MousePointerCrosshairs | Display crosshairs centered on mouse. | [MousePointerCrosshairs module][20] |
|
||||
| Peek | Quick file previewer. | [Peek module][21] |
|
||||
| PowerAccent | Quick accent character selector. | [PowerAccent module][22] |
|
||||
| PowerOCR | Extract text from images. | [PowerOCR module][23] |
|
||||
| PowerRename | Bulk rename files. | [PowerRename module][24] |
|
||||
| RegistryPreview | Visualize and edit registry files. | [RegistryPreview module][25] |
|
||||
| ShortcutGuide | Display keyboard shortcuts. | [ShortcutGuide module][26] |
|
||||
| Workspaces | Save and restore application sets. | [Workspaces module][27] |
|
||||
| ZoomIt | Screen zoom and annotation tool. | [ZoomIt module][28] |
|
||||
|
||||
## Common operations
|
||||
|
||||
### List all supported modules
|
||||
|
||||
```powershell
|
||||
PowerToys.DSC.exe modules --resource 'settings'
|
||||
```
|
||||
|
||||
### Get current configuration
|
||||
|
||||
```powershell
|
||||
# Get configuration for a specific module.
|
||||
PowerToys.DSC.exe get --resource 'settings' --module FancyZones
|
||||
|
||||
# Export configuration (identical to get).
|
||||
PowerToys.DSC.exe export --resource 'settings' --module FancyZones
|
||||
```
|
||||
|
||||
### Apply configuration
|
||||
|
||||
```powershell
|
||||
# Set configuration for a module.
|
||||
$input = '{"settings":{...}}'
|
||||
PowerToys.DSC.exe set --resource 'settings' --module FancyZones --input $input
|
||||
```
|
||||
|
||||
### Validate configuration
|
||||
|
||||
```powershell
|
||||
# Test if current state matches desired state.
|
||||
$input = '{"settings":{...}}'
|
||||
PowerToys.DSC.exe test --resource 'settings' --module FancyZones --input $input
|
||||
```
|
||||
|
||||
### Generate schema
|
||||
|
||||
```powershell
|
||||
# Get JSON schema for a module's settings.
|
||||
PowerToys.DSC.exe schema --resource 'settings' --module FancyZones
|
||||
```
|
||||
|
||||
### Generate DSC manifest
|
||||
|
||||
```powershell
|
||||
# Generate manifest for a specific module.
|
||||
$outputDir = "C:\manifests"
|
||||
PowerToys.DSC.exe manifest --resource 'settings' --module FancyZones `
|
||||
--outputDir $outputDir
|
||||
|
||||
# Generate manifests for all modules.
|
||||
PowerToys.DSC.exe manifest --resource 'settings' --outputDir $outputDir
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
For complete examples, see:
|
||||
|
||||
- [Settings Resource Examples][29]
|
||||
- Individual module documentation in the [modules][30] folder
|
||||
|
||||
## See also
|
||||
|
||||
- [Settings Resource Reference][03]
|
||||
- [PowerToys.DSC.exe Command Reference][01]
|
||||
- [Module Documentation][30]
|
||||
- [Microsoft DSC Documentation][31]
|
||||
- [WinGet Configuration Documentation][32]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ./modules/
|
||||
[03]: ./settings-resource.md
|
||||
[04]: ./modules/App.md
|
||||
[05]: ./modules/AdvancedPaste.md
|
||||
[06]: ./modules/AlwaysOnTop.md
|
||||
[07]: ./modules/Awake.md
|
||||
[08]: ./modules/ColorPicker.md
|
||||
[09]: ./modules/CropAndLock.md
|
||||
[10]: ./modules/EnvironmentVariables.md
|
||||
[11]: ./modules/FancyZones.md
|
||||
[12]: ./modules/FileLocksmith.md
|
||||
[13]: ./modules/FindMyMouse.md
|
||||
[14]: ./modules/Hosts.md
|
||||
[15]: ./modules/ImageResizer.md
|
||||
[16]: ./modules/KeyboardManager.md
|
||||
[17]: ./modules/MeasureTool.md
|
||||
[18]: ./modules/MouseHighlighter.md
|
||||
[19]: ./modules/MouseJump.md
|
||||
[20]: ./modules/MousePointerCrosshairs.md
|
||||
[21]: ./modules/Peek.md
|
||||
[22]: ./modules/PowerAccent.md
|
||||
[23]: ./modules/PowerOCR.md
|
||||
[24]: ./modules/PowerRename.md
|
||||
[25]: ./modules/RegistryPreview.md
|
||||
[26]: ./modules/ShortcutGuide.md
|
||||
[27]: ./modules/Workspaces.md
|
||||
[28]: ./modules/ZoomIt.md
|
||||
[29]: ./settings-resource.md#examples
|
||||
[30]: ./modules/
|
||||
[31]: https://learn.microsoft.com/powershell/dsc/overview
|
||||
[32]: https://learn.microsoft.com/windows/package-manager/configuration/
|
||||
458
doc/dsc/settings-resource.md
Normal file
458
doc/dsc/settings-resource.md
Normal file
@@ -0,0 +1,458 @@
|
||||
---
|
||||
description: Reference for the PowerToys DSC settings resource
|
||||
ms.date: 10/18/2025
|
||||
ms.topic: reference
|
||||
title: Settings Resource
|
||||
---
|
||||
|
||||
# Settings Resource
|
||||
|
||||
## Synopsis
|
||||
|
||||
Manages configuration settings for PowerToys utilities (modules).
|
||||
|
||||
## Description
|
||||
|
||||
The `settings` resource provides Microsoft Desired State Configuration (DSC)
|
||||
support for managing PowerToys configuration. It enables declarative
|
||||
configuration of PowerToys utilities, allowing you to define, test, and
|
||||
enforce desired states for each module.
|
||||
|
||||
Each PowerToys utility (module) has its own configurable properties that can
|
||||
be managed through this resource. The settings resource supports standard DSC
|
||||
operations: get, set, test, export, schema, and manifest generation.
|
||||
|
||||
## Supported modules
|
||||
|
||||
The settings resource supports the following PowerToys modules:
|
||||
|
||||
- **App** - General application settings (enable/disable utilities, run at
|
||||
startup, theme, etc.).
|
||||
- **AdvancedPaste** - Advanced clipboard and paste operations.
|
||||
- **AlwaysOnTop** - Window pinning configuration.
|
||||
- **Awake** - Keep-awake timer settings.
|
||||
- **ColorPicker** - Color picker activation and format settings.
|
||||
- **CropAndLock** - Window cropping settings.
|
||||
- **EnvironmentVariables** - Environment variable editor settings.
|
||||
- **FancyZones** - Window layout and zone configuration.
|
||||
- **FileLocksmith** - File lock detection settings.
|
||||
- **FindMyMouse** - Mouse locator settings.
|
||||
- **Hosts** - Hosts file editor settings.
|
||||
- **ImageResizer** - Image resize configuration.
|
||||
- **KeyboardManager** - Key remapping and shortcut settings.
|
||||
- **MeasureTool** - Screen measurement tool settings.
|
||||
- **MouseHighlighter** - Mouse highlighting configuration.
|
||||
- **MouseJump** - Mouse jump navigation settings.
|
||||
- **MousePointerCrosshairs** - Crosshair display settings.
|
||||
- **Peek** - File preview settings.
|
||||
- **PowerAccent** - Accent character selection settings.
|
||||
- **PowerOCR** - Text extraction settings.
|
||||
- **PowerRename** - Bulk rename configuration.
|
||||
- **RegistryPreview** - Registry file preview settings.
|
||||
- **ShortcutGuide** - Keyboard shortcut overlay settings.
|
||||
- **Workspaces** - Application workspace settings.
|
||||
- **ZoomIt** - Screen zoom and annotation settings.
|
||||
|
||||
For detailed property information for each module, see the individual [module
|
||||
documentation][01].
|
||||
|
||||
## Operations
|
||||
|
||||
### List supported modules
|
||||
|
||||
List all modules that can be configured with the settings resource.
|
||||
|
||||
**Direct execution:**
|
||||
|
||||
```powershell
|
||||
# List all configurable modules.
|
||||
PowerToys.DSC.exe modules --resource 'settings'
|
||||
```
|
||||
|
||||
### Get current state
|
||||
|
||||
Retrieve the current configuration state for a module.
|
||||
|
||||
**Direct execution:**
|
||||
|
||||
```powershell
|
||||
# Get current settings for a module.
|
||||
PowerToys.DSC.exe get --resource 'settings' --module <ModuleName>
|
||||
```
|
||||
|
||||
**DSC configuration:**
|
||||
|
||||
```yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Get Awake settings
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties: {}
|
||||
```
|
||||
|
||||
**WinGet configuration:**
|
||||
|
||||
```yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Get FancyZones settings
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties: {}
|
||||
```
|
||||
|
||||
### Export current state
|
||||
|
||||
Export the current configuration state. The output is identical to the `get`
|
||||
operation.
|
||||
|
||||
**Direct execution:**
|
||||
|
||||
```powershell
|
||||
# Export current settings for a module.
|
||||
PowerToys.DSC.exe export --resource 'settings' --module <ModuleName>
|
||||
```
|
||||
|
||||
### Set desired state
|
||||
|
||||
Apply a configuration to a module, updating only the properties that differ
|
||||
from the desired state.
|
||||
|
||||
**Direct execution:**
|
||||
|
||||
```powershell
|
||||
# Set desired configuration for a module.
|
||||
$input = '{
|
||||
"settings": {
|
||||
"properties": {
|
||||
"keepDisplayOn": true,
|
||||
"mode": 1
|
||||
},
|
||||
"name": "Awake",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
}'
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Awake --input $input
|
||||
```
|
||||
|
||||
**DSC configuration:**
|
||||
|
||||
```yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Configure Awake
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
keepDisplayOn: true
|
||||
mode: 1
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
**WinGet configuration:**
|
||||
|
||||
```yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install and configure PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
|
||||
- name: Configure FancyZones
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_shiftDrag: true
|
||||
fancyzones_mouseSwitch: true
|
||||
fancyzones_displayOrWorkAreaChange_moveWindows: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Test desired state
|
||||
|
||||
Verify whether the current configuration matches the desired state.
|
||||
|
||||
**Direct execution:**
|
||||
|
||||
```powershell
|
||||
# Test if current state matches desired state.
|
||||
$input = '{
|
||||
"settings": {
|
||||
"properties": {
|
||||
"keepDisplayOn": true,
|
||||
"mode": 1
|
||||
},
|
||||
"name": "Awake",
|
||||
"version": "0.0.1"
|
||||
}
|
||||
}'
|
||||
PowerToys.DSC.exe test --resource 'settings' --module Awake --input $input
|
||||
```
|
||||
|
||||
The output includes an `_inDesiredState` property indicating whether the
|
||||
configuration matches (`true`) or differs (`false`).
|
||||
|
||||
**DSC configuration:**
|
||||
|
||||
```yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Test Awake configuration
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
keepDisplayOn: true
|
||||
mode: 1
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
```
|
||||
|
||||
### Get schema
|
||||
|
||||
Generate the JSON schema for a module's settings, describing all configurable
|
||||
properties and their types.
|
||||
|
||||
**Direct execution:**
|
||||
|
||||
```powershell
|
||||
# Get JSON schema for a module.
|
||||
PowerToys.DSC.exe schema --resource 'settings' --module Awake
|
||||
|
||||
# Format for readability.
|
||||
PowerToys.DSC.exe schema --resource 'settings' --module Awake `
|
||||
| ConvertFrom-Json | ConvertTo-Json -Depth 10
|
||||
```
|
||||
|
||||
### Generate manifest
|
||||
|
||||
Create a DSC resource manifest file for one or all modules.
|
||||
|
||||
**Direct execution:**
|
||||
|
||||
```powershell
|
||||
# Generate manifest for a specific module.
|
||||
$outputDir = "C:\manifests"
|
||||
PowerToys.DSC.exe manifest --resource 'settings' --module Awake `
|
||||
--outputDir $outputDir
|
||||
|
||||
# Generate manifests for all modules.
|
||||
PowerToys.DSC.exe manifest --resource 'settings' --outputDir $outputDir
|
||||
|
||||
# Print manifest to console (omit --outputDir).
|
||||
PowerToys.DSC.exe manifest --resource 'settings' --module Awake
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1 - Enable and configure FancyZones
|
||||
|
||||
This example enables FancyZones and configures window dragging behavior using
|
||||
direct execution.
|
||||
|
||||
```powershell
|
||||
# Get current FancyZones settings.
|
||||
$current = PowerToys.DSC.exe get --resource 'settings' --module FancyZones `
|
||||
| ConvertFrom-Json
|
||||
|
||||
# Modify settings.
|
||||
$desired = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
fancyzones_shiftDrag = $true
|
||||
fancyzones_mouseSwitch = $true
|
||||
fancyzones_displayOrWorkAreaChange_moveWindows = $true
|
||||
}
|
||||
name = "FancyZones"
|
||||
version = "1.0"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
# Apply configuration.
|
||||
PowerToys.DSC.exe set --resource 'settings' --module FancyZones `
|
||||
--input $desired
|
||||
```
|
||||
|
||||
### Example 2 - Configure multiple utilities with DSC
|
||||
|
||||
This example configures multiple PowerToys utilities in a single DSC
|
||||
configuration.
|
||||
|
||||
```yaml
|
||||
# powertoys-multi.dsc.yaml
|
||||
$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
|
||||
resources:
|
||||
- name: Enable PowerToys utilities
|
||||
type: Microsoft.PowerToys/AppSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
Enabled:
|
||||
Awake: true
|
||||
FancyZones: true
|
||||
PowerRename: true
|
||||
ColorPicker: true
|
||||
name: App
|
||||
version: 1.0
|
||||
|
||||
- name: Configure Awake
|
||||
type: Microsoft.PowerToys/AwakeSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
keepDisplayOn: true
|
||||
mode: 1
|
||||
name: Awake
|
||||
version: 0.0.1
|
||||
|
||||
- name: Configure ColorPicker
|
||||
type: Microsoft.PowerToys/ColorPickerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
changecursor: true
|
||||
copiedcolorrepresentation: "HEX"
|
||||
name: ColorPicker
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
### Example 3 - Install and configure with WinGet
|
||||
|
||||
This example installs PowerToys and applies configuration using WinGet.
|
||||
|
||||
```yaml
|
||||
# winget-powertoys-setup.yaml
|
||||
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/08/config/document.json
|
||||
metadata:
|
||||
winget:
|
||||
processor: dscv3
|
||||
resources:
|
||||
- name: Install PowerToys
|
||||
type: Microsoft.WinGet.DSC/WinGetPackage
|
||||
properties:
|
||||
id: Microsoft.PowerToys
|
||||
source: winget
|
||||
ensure: Present
|
||||
|
||||
- name: Configure general settings
|
||||
type: Microsoft.PowerToys/AppSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
run_elevated: true
|
||||
startup: true
|
||||
theme: "dark"
|
||||
name: App
|
||||
version: 1.0
|
||||
|
||||
- name: Configure FancyZones
|
||||
type: Microsoft.PowerToys/FancyZonesSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
fancyzones_shiftDrag: true
|
||||
fancyzones_zoneSetChange_moveWindows: true
|
||||
name: FancyZones
|
||||
version: 1.0
|
||||
|
||||
- name: Configure ImageResizer
|
||||
type: Microsoft.PowerToys/ImageResizerSettings
|
||||
properties:
|
||||
settings:
|
||||
properties:
|
||||
ImageResizerSizes:
|
||||
- Name: Small
|
||||
Width: 854
|
||||
Height: 480
|
||||
Unit: Pixel
|
||||
Fit: Fit
|
||||
- Name: Medium
|
||||
Width: 1920
|
||||
Height: 1080
|
||||
Unit: Pixel
|
||||
Fit: Fit
|
||||
name: ImageResizer
|
||||
version: 1.0
|
||||
```
|
||||
|
||||
Apply the configuration:
|
||||
|
||||
```powershell
|
||||
winget configure winget-powertoys-setup.yaml
|
||||
```
|
||||
|
||||
### Example 4 - Test configuration drift
|
||||
|
||||
This example tests whether the current configuration matches the desired
|
||||
state.
|
||||
|
||||
```powershell
|
||||
# Define desired state.
|
||||
$desired = @{
|
||||
settings = @{
|
||||
properties = @{
|
||||
keepDisplayOn = $true
|
||||
mode = 1
|
||||
}
|
||||
name = "Awake"
|
||||
version = "0.0.1"
|
||||
}
|
||||
} | ConvertTo-Json -Depth 10 -Compress
|
||||
|
||||
# Test for drift.
|
||||
$result = PowerToys.DSC.exe test --resource 'settings' --module Awake `
|
||||
--input $desired | ConvertFrom-Json
|
||||
|
||||
if ($result._inDesiredState) {
|
||||
Write-Host "Configuration is in desired state"
|
||||
} else {
|
||||
Write-Host "Configuration has drifted from desired state"
|
||||
|
||||
# Apply configuration.
|
||||
PowerToys.DSC.exe set --resource 'settings' --module Awake `
|
||||
--input $desired
|
||||
}
|
||||
```
|
||||
|
||||
### Example 5 - Export all module configurations
|
||||
|
||||
This example exports configuration for all modules.
|
||||
|
||||
```powershell
|
||||
# Get list of all modules.
|
||||
$modules = PowerToys.DSC.exe modules --resource 'settings'
|
||||
|
||||
# Export each module's configuration.
|
||||
$configurations = @{}
|
||||
foreach ($module in $modules) {
|
||||
$config = PowerToys.DSC.exe export --resource 'settings' `
|
||||
--module $module | ConvertFrom-Json
|
||||
$configurations[$module] = $config
|
||||
}
|
||||
|
||||
# Save to file.
|
||||
$configurations | ConvertTo-Json -Depth 10 `
|
||||
| Out-File "powertoys-backup.json"
|
||||
```
|
||||
|
||||
## See also
|
||||
|
||||
- [PowerToys DSC Overview][02]
|
||||
- [Module Documentation][01]
|
||||
- [WinGet Configuration][03]
|
||||
|
||||
<!-- Link reference definitions -->
|
||||
[01]: ./modules/
|
||||
[02]: ./overview.md
|
||||
[03]: https://learn.microsoft.com/windows/package-manager/configuration/
|
||||
BIN
doc/images/readme/Release-Banner.png
Normal file
BIN
doc/images/readme/Release-Banner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
@@ -1594,6 +1594,7 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
|
||||
L"PowerToys.PowerRename.exe",
|
||||
L"PowerToys.ImageResizer.exe",
|
||||
L"PowerToys.LightSwitchService.exe",
|
||||
L"PowerToys.PowerDisplay.exe",
|
||||
L"PowerToys.GcodeThumbnailProvider.exe",
|
||||
L"PowerToys.BgcodeThumbnailProvider.exe",
|
||||
L"PowerToys.PdfThumbnailProvider.exe",
|
||||
|
||||
@@ -22,6 +22,16 @@
|
||||
|
||||
<ComponentGroup Id="DscResourcesComponentGroup">
|
||||
<ComponentRef Id="PowerToysDSCReference" />
|
||||
<?if $(var.PerUser) = "false" ?>
|
||||
<Component Id="SecureDSCModulesFolder" Guid="7D2F4E57-CCB2-4F89-9B8B-62E9B3CC4E12" Directory="DSCModulesReferenceFolder" Bitness="always64">
|
||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="SecureDSCModulesFolder" Value="" KeyPath="yes" />
|
||||
</RegistryKey>
|
||||
<CreateFolder>
|
||||
<PermissionEx Sddl="D:PAI(A;OICI;GA;;;SY)(A;OICI;GA;;;BA)(A;OICI;GRGX;;;BU)(A;OICIIO;GA;;;CO)" />
|
||||
</CreateFolder>
|
||||
</Component>
|
||||
<?endif?>
|
||||
<Component Id="RemoveDSCModulesFolder" Guid="A3C77D92-4E97-4C1A-9F2E-8B3C5D6E7F80" Directory="DSCModulesReferenceFolder">
|
||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="RemoveDSCModulesFolder" Value="" KeyPath="yes" />
|
||||
|
||||
@@ -2,7 +2,29 @@
|
||||
|
||||
<?include $(sys.CURRENTDIR)\Common.wxi?>
|
||||
|
||||
<?define KeyboardManagerAssetsFiles=?>
|
||||
<?define KeyboardManagerAssetsWinUI3Files=?>
|
||||
<?define KeyboardManagerAssetsFilesPath=$(var.BinDir)\Assets\KeyboardManager\?>
|
||||
<?define KeyboardManagerAssetsWinUI3FilesPath=$(var.BinDir)\WinUI3Apps\Assets\KeyboardManagerEditor\?>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="BaseApplicationsAssetsFolder">
|
||||
<Directory Id="KeyboardManagerAssetsInstallFolder" Name="KeyboardManager" />
|
||||
</DirectoryRef>
|
||||
<DirectoryRef Id="WinUI3AppsAssetsFolder">
|
||||
<Directory Id="KeyboardManagerAssetsWinUI3InstallFolder" Name="KeyboardManagerEditor" />
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="KeyboardManagerAssetsInstallFolder" FileSource="$(var.KeyboardManagerAssetsFilesPath)">
|
||||
<!-- Generated by generateFileComponents.ps1 -->
|
||||
<!--KeyboardManagerAssetsFiles_Component_Def-->
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="KeyboardManagerAssetsWinUI3InstallFolder" FileSource="$(var.KeyboardManagerAssetsWinUI3FilesPath)">
|
||||
<!-- Generated by generateFileComponents.ps1 -->
|
||||
<!--KeyboardManagerAssetsWinUI3Files_Component_Def-->
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="INSTALLFOLDER">
|
||||
<Directory Id="KeyboardManagerEditorInstallFolder" Name="KeyboardManagerEditor" />
|
||||
<Directory Id="KeyboardManagerEngineInstallFolder" Name="KeyboardManagerEngine" />
|
||||
@@ -44,6 +66,8 @@
|
||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="RemoveKeyboardManagerFolder" Value="" KeyPath="yes" />
|
||||
</RegistryKey>
|
||||
<RemoveFolder Id="RemoveFolderKeyboardManagerAssetsInstallFolder" Directory="KeyboardManagerAssetsInstallFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemoveFolderKeyboardManagerAssetsWinUI3InstallFolder" Directory="KeyboardManagerAssetsWinUI3InstallFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemoveFolderKeyboardManagerEditorFolder" Directory="KeyboardManagerEditorInstallFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemoveFolderKeyboardManagerEngineFolder" Directory="KeyboardManagerEngineInstallFolder" On="uninstall" />
|
||||
</Component>
|
||||
|
||||
@@ -47,6 +47,7 @@ call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuil
|
||||
call move /Y ..\..\..\NewPlus.wxs.bk ..\..\..\NewPlus.wxs
|
||||
call move /Y ..\..\..\Peek.wxs.bk ..\..\..\Peek.wxs
|
||||
call move /Y ..\..\..\PowerRename.wxs.bk ..\..\..\PowerRename.wxs
|
||||
call move /Y ..\..\..\PowerDisplay.wxs.bk ..\..\..\PowerDisplay.wxs
|
||||
call move /Y ..\..\..\Product.wxs.bk ..\..\..\Product.wxs
|
||||
call move /Y ..\..\..\RegistryPreview.wxs.bk ..\..\..\RegistryPreview.wxs
|
||||
call move /Y ..\..\..\Resources.wxs.bk ..\..\..\Resources.wxs
|
||||
@@ -123,6 +124,7 @@ call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuil
|
||||
<Compile Include="KeyboardManager.wxs" />
|
||||
<Compile Include="Peek.wxs" />
|
||||
<Compile Include="PowerRename.wxs" />
|
||||
<Compile Include="PowerDisplay.wxs" />
|
||||
<Compile Include="DscResources.wxs" />
|
||||
<Compile Include="RegistryPreview.wxs" />
|
||||
<Compile Include="Run.wxs" />
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
<ComponentGroupRef Id="LightSwitchComponentGroup" />
|
||||
<ComponentGroupRef Id="PeekComponentGroup" />
|
||||
<ComponentGroupRef Id="PowerRenameComponentGroup" />
|
||||
<ComponentGroupRef Id="PowerDisplayComponentGroup" />
|
||||
<ComponentGroupRef Id="RegistryPreviewComponentGroup" />
|
||||
<ComponentGroupRef Id="RunComponentGroup" />
|
||||
<ComponentGroupRef Id="SettingsComponentGroup" />
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<Fragment>
|
||||
<!-- Resource directories should be added only if the installer is built on the build farm -->
|
||||
<?ifdef env.IsPipeline?>
|
||||
<?foreach ParentDirectory in INSTALLFOLDER;WinUI3AppsInstallFolder;HistoryPluginFolder;CalculatorPluginFolder;FolderPluginFolder;ProgramPluginFolder;ShellPluginFolder;IndexerPluginFolder;UnitConverterPluginFolder;ValueGeneratorPluginFolder;UriPluginFolder;WindowWalkerPluginFolder;OneNotePluginFolder;RegistryPluginFolder;VSCodeWorkspacesPluginFolder;ServicePluginFolder;SystemPluginFolder;TimeDatePluginFolder;WindowsSettingsPluginFolder;WindowsTerminalPluginFolder;WebSearchPluginFolder;PowerToysPluginFolder?>
|
||||
<?foreach ParentDirectory in INSTALLFOLDER;HistoryPluginFolder;CalculatorPluginFolder;FolderPluginFolder;ProgramPluginFolder;ShellPluginFolder;IndexerPluginFolder;UnitConverterPluginFolder;ValueGeneratorPluginFolder;UriPluginFolder;WindowWalkerPluginFolder;OneNotePluginFolder;RegistryPluginFolder;VSCodeWorkspacesPluginFolder;ServicePluginFolder;SystemPluginFolder;TimeDatePluginFolder;WindowsSettingsPluginFolder;WindowsTerminalPluginFolder;WebSearchPluginFolder;PowerToysPluginFolder?>
|
||||
<DirectoryRef Id="$(var.ParentDirectory)">
|
||||
<!-- Resource file directories -->
|
||||
<?foreach Language in $(var.LocLanguageList)?>
|
||||
@@ -171,12 +171,6 @@
|
||||
</RegistryKey>
|
||||
<File Id="FancyZonesEditor_$(var.IdSafeLanguage)_File" Source="$(var.BinDir)\$(var.Language)\PowerToys.FancyZonesEditor.resources.dll" />
|
||||
</Component>
|
||||
<Component Id="ImageResizer_$(var.IdSafeLanguage)_Component" Directory="Resource$(var.IdSafeLanguage)WinUI3AppsInstallFolder" Guid="$(var.CompGUIDPrefix)02">
|
||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="ImageResizer_$(var.IdSafeLanguage)_Component" Value="" KeyPath="yes" />
|
||||
</RegistryKey>
|
||||
<File Id="ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinDir)\WinUI3Apps\$(var.Language)\PowerToys.ImageResizer.resources.dll" />
|
||||
</Component>
|
||||
<Component Id="ColorPicker_$(var.IdSafeLanguage)_Component" Directory="Resource$(var.IdSafeLanguage)INSTALLFOLDER" Guid="$(var.CompGUIDPrefix)03">
|
||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="ColorPicker_$(var.IdSafeLanguage)_Component" Value="" KeyPath="yes" />
|
||||
@@ -459,7 +453,6 @@
|
||||
<RemoveFolder Id="RemoveFolderResourcesResource$(var.IdSafeLanguage)HistoryPluginFolder" Directory="Resource$(var.IdSafeLanguage)HistoryPluginFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemoveFolderResourcesResource$(var.IdSafeLanguage)PowerToysPluginFolder" Directory="Resource$(var.IdSafeLanguage)PowerToysPluginFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemoveFolderResourcesResource$(var.IdSafeLanguage)ValueGeneratorPluginFolder" Directory="Resource$(var.IdSafeLanguage)ValueGeneratorPluginFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemoveFolderResourcesResource$(var.IdSafeLanguage)WinUI3AppsInstallFolder" Directory="Resource$(var.IdSafeLanguage)WinUI3AppsInstallFolder" On="uninstall"/>
|
||||
<?undef IdSafeLanguage?>
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
|
||||
@@ -131,7 +131,25 @@ if ($platform -ceq "arm64") {
|
||||
}
|
||||
|
||||
#BaseApplications
|
||||
# WORKAROUND: Exclude ImageResizer files that leak into the root output directory.
|
||||
# ImageResizerCLI (Exe, SelfContained) has a ProjectReference to ImageResizerUI (WinExe, SelfContained).
|
||||
# MSBuild copies the referenced WinExe's apphost (.exe, .deps.json, .runtimeconfig.json) to the root
|
||||
# output directory as a side effect. These files are incomplete (missing the managed .dll) and should
|
||||
# not be included in the installer. The complete ImageResizer files are in WinUI3Apps/ and are handled
|
||||
# by WinUI3ApplicationsFiles. TODO: Refactor ImageResizer to use a shared Library project instead.
|
||||
Generate-FileList -fileDepsJson "" -fileListName BaseApplicationsFiles -wxsFilePath $PSScriptRoot\BaseApplications.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release"
|
||||
|
||||
# Remove leaked ImageResizer artifacts from BaseApplications
|
||||
$baseAppWxsPath = "$PSScriptRoot\BaseApplications.wxs"
|
||||
$baseAppWxs = Get-Content $baseAppWxsPath -Raw
|
||||
$baseAppWxs = $baseAppWxs -replace 'PowerToys\.ImageResizer\.exe;?', ''
|
||||
$baseAppWxs = $baseAppWxs -replace 'PowerToys\.ImageResizer\.deps\.json;?', ''
|
||||
$baseAppWxs = $baseAppWxs -replace 'PowerToys\.ImageResizer\.runtimeconfig\.json;?', ''
|
||||
# Clean up trailing/double semicolons left after removal
|
||||
$baseAppWxs = $baseAppWxs -replace ';;+', ';'
|
||||
$baseAppWxs = $baseAppWxs -replace '=;', '='
|
||||
$baseAppWxs = $baseAppWxs -replace ';"', '"'
|
||||
Set-Content -Path $baseAppWxsPath -Value $baseAppWxs
|
||||
Generate-FileComponents -fileListName "BaseApplicationsFiles" -wxsFilePath $PSScriptRoot\BaseApplications.wxs
|
||||
|
||||
#WinUI3Applications
|
||||
@@ -172,6 +190,12 @@ Generate-FileComponents -fileListName "HostsAssetsFiles" -wxsFilePath $PSScriptR
|
||||
Generate-FileList -fileDepsJson "" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\ImageResizer"
|
||||
Generate-FileComponents -fileListName "ImageResizerAssetsFiles" -wxsFilePath $PSScriptRoot\ImageResizer.wxs
|
||||
|
||||
#KeyboardManager
|
||||
Generate-FileList -fileDepsJson "" -fileListName KeyboardManagerAssetsFiles -wxsFilePath $PSScriptRoot\KeyboardManager.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\KeyboardManager"
|
||||
Generate-FileList -fileDepsJson "" -fileListName KeyboardManagerAssetsWinUI3Files -wxsFilePath $PSScriptRoot\KeyboardManager.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\KeyboardManagerEditor"
|
||||
Generate-FileComponents -fileListName "KeyboardManagerAssetsFiles" -wxsFilePath $PSScriptRoot\KeyboardManager.wxs
|
||||
Generate-FileComponents -fileListName "KeyboardManagerAssetsWinUI3Files" -wxsFilePath $PSScriptRoot\KeyboardManager.wxs
|
||||
|
||||
# Light Switch Service
|
||||
Generate-FileList -fileDepsJson "" -fileListName LightSwitchFiles -wxsFilePath $PSScriptRoot\LightSwitch.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\LightSwitchService"
|
||||
Generate-FileComponents -fileListName "LightSwitchFiles" -wxsFilePath $PSScriptRoot\LightSwitch.wxs
|
||||
@@ -188,6 +212,10 @@ Generate-FileComponents -fileListName "PeekAssetsFiles" -wxsFilePath $PSScriptRo
|
||||
Generate-FileList -fileDepsJson "" -fileListName PowerRenameAssetsFiles -wxsFilePath $PSScriptRoot\PowerRename.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\PowerRename\"
|
||||
Generate-FileComponents -fileListName "PowerRenameAssetsFiles" -wxsFilePath $PSScriptRoot\PowerRename.wxs
|
||||
|
||||
#PowerDisplay
|
||||
Generate-FileList -fileDepsJson "" -fileListName PowerDisplayAssetsFiles -wxsFilePath $PSScriptRoot\PowerDisplay.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\PowerDisplay\"
|
||||
Generate-FileComponents -fileListName "PowerDisplayAssetsFiles" -wxsFilePath $PSScriptRoot\PowerDisplay.wxs
|
||||
|
||||
#RegistryPreview
|
||||
Generate-FileList -fileDepsJson "" -fileListName RegistryPreviewAssetsFiles -wxsFilePath $PSScriptRoot\RegistryPreview.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\RegistryPreview\"
|
||||
Generate-FileComponents -fileListName "RegistryPreviewAssetsFiles" -wxsFilePath $PSScriptRoot\RegistryPreview.wxs
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h actionRunner.base.rc actionRunner.rc" />
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h actionRunner.base.rc actionRunner.rc" />
|
||||
</Target>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include <common/updating/updating.h>
|
||||
#include <common/updating/updateState.h>
|
||||
#include <common/updating/installer.h>
|
||||
#include <common/updating/configBackup.h>
|
||||
#include <common/updating/updateLifecycle.h>
|
||||
|
||||
#include <common/utils/elevation.h>
|
||||
#include <common/utils/HttpClient.h>
|
||||
@@ -21,6 +23,8 @@
|
||||
#include <common/utils/resources.h>
|
||||
#include <common/utils/timeutil.h>
|
||||
|
||||
#include <wil/resource.h>
|
||||
|
||||
#include <common/SettingsAPI/settings_helpers.h>
|
||||
|
||||
#include <common/logger/logger.h>
|
||||
@@ -38,15 +42,16 @@ namespace fs = std::filesystem;
|
||||
|
||||
std::optional<fs::path> CopySelfToTempDir()
|
||||
{
|
||||
// D5 fix: Use unique temp path with PID to avoid collision on concurrent updates
|
||||
std::error_code error;
|
||||
auto dst_path = fs::temp_directory_path() / "PowerToys.Update.exe";
|
||||
auto dst_path = fs::temp_directory_path() / (L"PowerToys.Update." + std::to_wstring(GetCurrentProcessId()) + L".exe");
|
||||
fs::copy_file(get_module_filename(), dst_path, fs::copy_options::overwrite_existing, error);
|
||||
if (error)
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return std::move(dst_path);
|
||||
return dst_path;
|
||||
}
|
||||
|
||||
std::optional<fs::path> ObtainInstaller(bool& isUpToDate)
|
||||
@@ -57,34 +62,9 @@ std::optional<fs::path> ObtainInstaller(bool& isUpToDate)
|
||||
|
||||
auto state = UpdateState::read();
|
||||
|
||||
const auto new_version_info = std::move(get_github_version_info_async()).get();
|
||||
if (std::holds_alternative<version_up_to_date>(*new_version_info))
|
||||
{
|
||||
isUpToDate = true;
|
||||
Logger::error("Invoked with -update_now argument, but no update was available");
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (state.state == UpdateState::readyToDownload || state.state == UpdateState::errorDownloading)
|
||||
{
|
||||
if (!new_version_info)
|
||||
{
|
||||
Logger::error(L"Couldn't obtain github version info: {}", new_version_info.error());
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Cleanup old updates before downloading the latest
|
||||
updating::cleanup_updates();
|
||||
|
||||
auto downloaded_installer = std::move(download_new_version_async(std::get<new_version_download_info>(*new_version_info))).get();
|
||||
if (!downloaded_installer)
|
||||
{
|
||||
Logger::error("Couldn't download new installer");
|
||||
}
|
||||
|
||||
return downloaded_installer;
|
||||
}
|
||||
else if (state.state == UpdateState::readyToInstall)
|
||||
// Handle readyToInstall first — the installer is already on disk,
|
||||
// so we don't need a GitHub API call (which may fail if offline).
|
||||
if (state.state == UpdateState::readyToInstall)
|
||||
{
|
||||
fs::path installer{ get_pending_updates_path() / state.downloadedInstallerFilename };
|
||||
if (fs::is_regular_file(installer))
|
||||
@@ -97,12 +77,44 @@ std::optional<fs::path> ObtainInstaller(bool& isUpToDate)
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
else if (state.state == UpdateState::upToDate)
|
||||
|
||||
if (state.state == UpdateState::upToDate)
|
||||
{
|
||||
isUpToDate = true;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const auto new_version_info = std::move(get_github_version_info_async()).get();
|
||||
|
||||
// Check for error BEFORE dereferencing — the old code crashed here
|
||||
// when GitHub API was unreachable (new_version_info held an error string).
|
||||
if (!new_version_info)
|
||||
{
|
||||
Logger::error(L"Couldn't obtain github version info: {}", new_version_info.error());
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (std::holds_alternative<version_up_to_date>(*new_version_info))
|
||||
{
|
||||
isUpToDate = true;
|
||||
Logger::error("Invoked with -update_now argument, but no update was available");
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (state.state == UpdateState::readyToDownload || state.state == UpdateState::errorDownloading)
|
||||
{
|
||||
// Cleanup old updates before downloading the latest
|
||||
updating::cleanup_updates();
|
||||
|
||||
auto downloaded_installer = std::move(download_new_version_async(std::get<new_version_download_info>(*new_version_info))).get();
|
||||
if (!downloaded_installer)
|
||||
{
|
||||
Logger::error("Couldn't download new installer");
|
||||
}
|
||||
|
||||
return downloaded_installer;
|
||||
}
|
||||
|
||||
Logger::error("Invoked with -update_now argument, but update state was invalid");
|
||||
return std::nullopt;
|
||||
}
|
||||
@@ -116,13 +128,29 @@ bool InstallNewVersionStage1(fs::path installer)
|
||||
|
||||
if (pt_main_window != nullptr)
|
||||
{
|
||||
// Get the process that owns the tray window so we can wait for it to exit
|
||||
DWORD ptProcessId = 0;
|
||||
GetWindowThreadProcessId(pt_main_window, &ptProcessId);
|
||||
|
||||
SendMessageW(pt_main_window, WM_CLOSE, 0, 0);
|
||||
|
||||
// D4 fix: Wait for PT to actually exit before launching installer.
|
||||
// Without this, the installer may find PT files locked.
|
||||
if (ptProcessId != 0)
|
||||
{
|
||||
wil::unique_handle ptProcess{ OpenProcess(SYNCHRONIZE, FALSE, ptProcessId) };
|
||||
if (ptProcess)
|
||||
{
|
||||
WaitForSingleObject(ptProcess.get(), 10000); // 10 second timeout
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::wstring arguments{ UPDATE_NOW_LAUNCH_STAGE2 };
|
||||
arguments += L" \"";
|
||||
arguments += installer.c_str();
|
||||
arguments += L"\"";
|
||||
// Pass the install directory so Stage 2 can relaunch PowerToys after install
|
||||
const std::wstring installDir = get_module_folderpath();
|
||||
|
||||
std::wstring arguments = updating::BuildStage2Arguments(
|
||||
UPDATE_NOW_LAUNCH_STAGE2, installer, fs::path(installDir));
|
||||
SHELLEXECUTEINFOW sei{ sizeof(sei) };
|
||||
sei.fMask = { SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC };
|
||||
sei.lpFile = copy_in_temp->c_str();
|
||||
@@ -190,9 +218,16 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
LPWSTR* args = CommandLineToArgvW(GetCommandLineW(), &nArgs);
|
||||
if (!args || nArgs < 2)
|
||||
{
|
||||
if (args)
|
||||
{
|
||||
LocalFree(args);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
// D3 fix: ensure args is freed on all exit paths
|
||||
auto freeArgs = wil::scope_exit([&] { LocalFree(args); });
|
||||
|
||||
std::wstring_view action{ args[1] };
|
||||
|
||||
std::filesystem::path logFilePath(PTSettingsHelper::get_root_save_folder_location());
|
||||
@@ -201,6 +236,10 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
|
||||
if (action == UPDATE_NOW_LAUNCH_STAGE1)
|
||||
{
|
||||
// Backup config files before the update to protect against corruption
|
||||
Logger::info("Backing up config files before update");
|
||||
updating::BackupConfigFiles(fs::path(PTSettingsHelper::get_root_save_folder_location()));
|
||||
|
||||
bool isUpToDate = false;
|
||||
auto installerPath = ObtainInstaller(isUpToDate);
|
||||
bool failed = !installerPath.has_value();
|
||||
@@ -217,6 +256,12 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
}
|
||||
else if (action == UPDATE_NOW_LAUNCH_STAGE2)
|
||||
{
|
||||
if (nArgs < 3)
|
||||
{
|
||||
Logger::error("Stage 2 invoked without installer path argument");
|
||||
return 1;
|
||||
}
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
const bool failed = !InstallNewVersionStage2(args[2]);
|
||||
if (failed)
|
||||
@@ -227,6 +272,37 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
state.state = UpdateState::errorDownloading;
|
||||
});
|
||||
}
|
||||
|
||||
// D7 fix: Always check for corrupted configs after Stage 2, regardless
|
||||
// of install success/failure. A failed install may still corrupt configs.
|
||||
Logger::info("Checking for corrupted config files after update");
|
||||
updating::RestoreCorruptedConfigs(fs::path(PTSettingsHelper::get_root_save_folder_location()));
|
||||
|
||||
if (!failed)
|
||||
{
|
||||
// Relaunch PowerToys from the install directory
|
||||
if (updating::CanRelaunchAfterUpdate(nArgs))
|
||||
{
|
||||
std::wstring ptExePath = updating::BuildPowerToysExePath(args[3]);
|
||||
|
||||
Logger::info(L"Relaunching PowerToys after update: {}", ptExePath);
|
||||
|
||||
SHELLEXECUTEINFOW sei{ sizeof(sei) };
|
||||
sei.fMask = { SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC };
|
||||
sei.lpFile = ptExePath.c_str();
|
||||
sei.nShow = SW_SHOWNORMAL;
|
||||
sei.lpParameters = UPDATE_REPORT_SUCCESS;
|
||||
|
||||
if (!ShellExecuteExW(&sei))
|
||||
{
|
||||
Logger::error(L"Failed to relaunch PowerToys after update");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger::warn("Install directory not provided to Stage 2 - cannot relaunch PowerToys");
|
||||
}
|
||||
}
|
||||
return failed;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h PowerToys.Update.base.rc PowerToys.Update.rc" />
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h PowerToys.Update.base.rc PowerToys.Update.rc" />
|
||||
</Target>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.231216.1" targetFramework="native" />
|
||||
</packages>
|
||||
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.250325.1" targetFramework="native" />
|
||||
</packages>
|
||||
|
||||
@@ -105,6 +105,22 @@ namespace Microsoft.PowerToys.Common.UI.Controls
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case nameof(VirtualKey.Up):
|
||||
SetGlyphOrText("\uE0E4", VirtualKey.Up);
|
||||
break;
|
||||
|
||||
case nameof(VirtualKey.Down):
|
||||
SetGlyphOrText("\uE0E5", VirtualKey.Down);
|
||||
break;
|
||||
|
||||
case nameof(VirtualKey.Left):
|
||||
SetGlyphOrText("\uE0E2", VirtualKey.Left);
|
||||
break;
|
||||
|
||||
case nameof(VirtualKey.Right):
|
||||
SetGlyphOrText("\uE0E3", VirtualKey.Right);
|
||||
break;
|
||||
|
||||
case "Copilot":
|
||||
_keyPresenter.Style = (Style)Application.Current.Resources["CopilotKeyCharPresenterStyle"];
|
||||
break;
|
||||
@@ -141,19 +157,19 @@ namespace Microsoft.PowerToys.Common.UI.Controls
|
||||
break;
|
||||
|
||||
case VirtualKey.Up:
|
||||
_keyPresenter.Content = "\uE0E4";
|
||||
SetGlyphOrText("\uE0E4", virtualKey);
|
||||
break;
|
||||
|
||||
case VirtualKey.Down:
|
||||
_keyPresenter.Content = "\uE0E5";
|
||||
SetGlyphOrText("\uE0E5", virtualKey);
|
||||
break;
|
||||
|
||||
case VirtualKey.Left:
|
||||
_keyPresenter.Content = "\uE0E2";
|
||||
SetGlyphOrText("\uE0E2", virtualKey);
|
||||
break;
|
||||
|
||||
case VirtualKey.Right:
|
||||
_keyPresenter.Content = "\uE0E3";
|
||||
SetGlyphOrText("\uE0E3", virtualKey);
|
||||
break;
|
||||
|
||||
case VirtualKey.LeftWindows:
|
||||
|
||||
@@ -287,8 +287,22 @@ namespace winrt::PowerToys::Interop::implementation
|
||||
{
|
||||
return CommonSharedConstants::POWER_DISPLAY_TERMINATE_APP_MESSAGE;
|
||||
}
|
||||
hstring Constants::MWBToggleEasyMouseEvent()
|
||||
{
|
||||
return CommonSharedConstants::MWB_TOGGLE_EASY_MOUSE_EVENT;
|
||||
}
|
||||
hstring Constants::MWBReconnectEvent()
|
||||
{
|
||||
return CommonSharedConstants::MWB_RECONNECT_EVENT;
|
||||
}
|
||||
|
||||
hstring Constants::OpenNewKeyboardManagerEvent()
|
||||
{
|
||||
return CommonSharedConstants::OPEN_NEW_KEYBOARD_MANAGER_EVENT;
|
||||
}
|
||||
hstring Constants::KeyboardManagerEngineInstanceMutex()
|
||||
{
|
||||
return CommonSharedConstants::KEYBOARD_MANAGER_ENGINE_INSTANCE_MUTEX;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,10 @@ namespace winrt::PowerToys::Interop::implementation
|
||||
static hstring PowerDisplayToggleMessage();
|
||||
static hstring PowerDisplayApplyProfileMessage();
|
||||
static hstring PowerDisplayTerminateAppMessage();
|
||||
static hstring MWBToggleEasyMouseEvent();
|
||||
static hstring MWBReconnectEvent();
|
||||
static hstring OpenNewKeyboardManagerEvent();
|
||||
static hstring KeyboardManagerEngineInstanceMutex();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -85,3 +88,4 @@ namespace winrt::PowerToys::Interop::factory_implementation
|
||||
{
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,11 @@ namespace PowerToys
|
||||
static String PowerDisplayToggleMessage();
|
||||
static String PowerDisplayApplyProfileMessage();
|
||||
static String PowerDisplayTerminateAppMessage();
|
||||
static String MWBToggleEasyMouseEvent();
|
||||
static String MWBReconnectEvent();
|
||||
static String OpenNewKeyboardManagerEvent();
|
||||
static String KeyboardManagerEngineInstanceMutex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,6 +151,7 @@ namespace CommonSharedConstants
|
||||
const wchar_t ZOOMIT_BREAK_EVENT[] = L"Local\\PowerToysZoomIt-BreakEvent-17f2e63c-4c56-41dd-90a0-2d12f9f50c6b";
|
||||
const wchar_t ZOOMIT_LIVEZOOM_EVENT[] = L"Local\\PowerToysZoomIt-LiveZoomEvent-390bf0c7-616f-47dc-bafe-a2d228add20d";
|
||||
const wchar_t ZOOMIT_SNIP_EVENT[] = L"Local\\PowerToysZoomIt-SnipEvent-2fd9c211-436d-4f17-a902-2528aaae3e30";
|
||||
const wchar_t ZOOMIT_SNIPOCR_EVENT[] = L"Local\\PowerToysZoomIt-SnipOcrEvent-a7c3b1d2-9e4f-4a6b-8d5c-1f2e3a4b5c6d";
|
||||
const wchar_t ZOOMIT_RECORD_EVENT[] = L"Local\\PowerToysZoomIt-RecordEvent-74539344-eaad-4711-8e83-23946e424512";
|
||||
|
||||
// Path to the events used by PowerDisplay
|
||||
@@ -172,11 +173,17 @@ namespace CommonSharedConstants
|
||||
|
||||
// Path to events used by Keyboard Manager
|
||||
const wchar_t OPEN_NEW_KEYBOARD_MANAGER_EVENT[] = L"Local\\PowerToysOpenNewKeyboardManagerEvent-9c1d2e3f-4b5a-6c7d-8e9f-0a1b2c3d4e5f";
|
||||
const wchar_t KEYBOARD_MANAGER_ENGINE_INSTANCE_MUTEX[] = L"Local\\PowerToys_KBMEngine_InstanceMutex";
|
||||
|
||||
// used from quick access window
|
||||
const wchar_t CMDPAL_SHOW_EVENT[] = L"Local\\PowerToysCmdPal-ShowEvent-62336fcd-8611-4023-9b30-091a6af4cc5a";
|
||||
const wchar_t CMDPAL_EXIT_EVENT[] = L"Local\\PowerToysCmdPal-ExitEvent-eb73f6be-3f22-4b36-aee3-62924ba40bfd";
|
||||
|
||||
// Path to the events used by MouseWithoutBorders
|
||||
const wchar_t MWB_TOGGLE_EASY_MOUSE_EVENT[] = L"Local\\PowerToysMWB-ToggleEasyMouseEvent-a9c8d7b6-e5f4-3c2a-1b0d-9e8f7a6b5c4d";
|
||||
const wchar_t MWB_RECONNECT_EVENT[] = L"Local\\PowerToysMWB-ReconnectEvent-b8d7c6a5-f4e3-2b1c-0a9d-8e7f6a5b4c3d";
|
||||
|
||||
// Max DWORD for key code to disable keys.
|
||||
const DWORD VK_DISABLED = 0x100;
|
||||
}
|
||||
|
||||
|
||||
679
src/common/updating/UnitTests/UpdatingTests.cpp
Normal file
679
src/common/updating/UnitTests/UpdatingTests.cpp
Normal file
@@ -0,0 +1,679 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <common/updating/configBackup.h>
|
||||
#include <common/updating/updateLifecycle.h>
|
||||
|
||||
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
namespace UpdatingUnitTests
|
||||
{
|
||||
// Helper to create a temp directory for test isolation.
|
||||
// Each instance gets a unique subdirectory to prevent test interference.
|
||||
class TempDir
|
||||
{
|
||||
public:
|
||||
TempDir()
|
||||
{
|
||||
wchar_t tempPath[MAX_PATH + 1];
|
||||
GetTempPathW(MAX_PATH, tempPath);
|
||||
static std::atomic<int> counter{0};
|
||||
m_path = fs::path(tempPath) / (L"PowerToysUpdateTests_" + std::to_wstring(counter++));
|
||||
|
||||
// Ensure clean state
|
||||
std::error_code ec;
|
||||
fs::remove_all(m_path, ec);
|
||||
fs::create_directories(m_path, ec);
|
||||
}
|
||||
|
||||
~TempDir()
|
||||
{
|
||||
std::error_code ec;
|
||||
fs::remove_all(m_path, ec);
|
||||
}
|
||||
|
||||
const fs::path& path() const { return m_path; }
|
||||
|
||||
// Write a file with the given content
|
||||
void WriteFile(const fs::path& relativePath, const std::string& content)
|
||||
{
|
||||
auto fullPath = m_path / relativePath;
|
||||
fs::create_directories(fullPath.parent_path());
|
||||
std::ofstream file(fullPath, std::ios::binary);
|
||||
file.write(content.data(), content.size());
|
||||
}
|
||||
|
||||
// Write a file with raw bytes (including null bytes for corruption testing)
|
||||
void WriteFileBytes(const fs::path& relativePath, const std::vector<char>& bytes)
|
||||
{
|
||||
auto fullPath = m_path / relativePath;
|
||||
fs::create_directories(fullPath.parent_path());
|
||||
std::ofstream file(fullPath, std::ios::binary);
|
||||
file.write(bytes.data(), bytes.size());
|
||||
}
|
||||
|
||||
// Read file content as string
|
||||
std::string ReadFile(const fs::path& relativePath)
|
||||
{
|
||||
auto fullPath = m_path / relativePath;
|
||||
std::ifstream file(fullPath, std::ios::binary);
|
||||
return std::string(std::istreambuf_iterator<char>(file), std::istreambuf_iterator<char>());
|
||||
}
|
||||
|
||||
bool FileExists(const fs::path& relativePath)
|
||||
{
|
||||
return fs::exists(m_path / relativePath);
|
||||
}
|
||||
|
||||
private:
|
||||
fs::path m_path;
|
||||
};
|
||||
|
||||
TEST_CLASS(IsJsonFileCorruptedTests)
|
||||
{
|
||||
public:
|
||||
// Tests IsJsonFileCorrupted: valid JSON with no null bytes returns false.
|
||||
// Covers: configBackup.h IsJsonFileCorrupted — happy path, full file scan.
|
||||
TEST_METHOD(CleanJsonFileIsNotCorrupted)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"theme":"dark","startup":true})");
|
||||
|
||||
Assert::IsFalse(updating::IsJsonFileCorrupted(dir.path() / L"settings.json"));
|
||||
}
|
||||
|
||||
// Tests IsJsonFileCorrupted: zero-length file returns false (empty is not corrupted).
|
||||
// Covers: configBackup.h IsJsonFileCorrupted — file.read returns 0 bytes immediately.
|
||||
TEST_METHOD(EmptyFileIsNotCorrupted)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"empty.json", "");
|
||||
|
||||
Assert::IsFalse(updating::IsJsonFileCorrupted(dir.path() / L"empty.json"));
|
||||
}
|
||||
|
||||
// Tests IsJsonFileCorrupted: file containing embedded null bytes returns true.
|
||||
// Covers: configBackup.h IsJsonFileCorrupted — null byte detection within buffer.
|
||||
TEST_METHOD(FileWithNullBytesIsCorrupted)
|
||||
{
|
||||
TempDir dir;
|
||||
std::vector<char> corrupted = { '{', '"', 'a', '"', ':', '\0', '\0', '\0', '}' };
|
||||
dir.WriteFileBytes(L"corrupted.json", corrupted);
|
||||
|
||||
Assert::IsTrue(updating::IsJsonFileCorrupted(dir.path() / L"corrupted.json"));
|
||||
}
|
||||
|
||||
// Tests IsJsonFileCorrupted: file entirely filled with 0x00 bytes returns true.
|
||||
// Reproduces the exact bug from #46179 where installer zeroed out JSON files.
|
||||
// Covers: configBackup.h IsJsonFileCorrupted — first byte is null.
|
||||
TEST_METHOD(FileFilledWithNullBytesIsCorrupted)
|
||||
{
|
||||
TempDir dir;
|
||||
std::vector<char> allNulls(1024, '\0');
|
||||
dir.WriteFileBytes(L"workspaces.json", allNulls);
|
||||
|
||||
Assert::IsTrue(updating::IsJsonFileCorrupted(dir.path() / L"workspaces.json"));
|
||||
}
|
||||
|
||||
// Tests IsJsonFileCorrupted: path that does not exist returns false.
|
||||
// Covers: configBackup.h IsJsonFileCorrupted — file.is_open() check.
|
||||
TEST_METHOD(NonExistentFileIsNotCorrupted)
|
||||
{
|
||||
TempDir dir;
|
||||
|
||||
Assert::IsFalse(updating::IsJsonFileCorrupted(dir.path() / L"missing.json"));
|
||||
}
|
||||
|
||||
// Tests IsJsonFileCorrupted: file larger than the 4096-byte read chunk
|
||||
// with no null bytes returns false.
|
||||
// Covers: configBackup.h IsJsonFileCorrupted — multi-chunk while loop.
|
||||
TEST_METHOD(LargeCleanFileIsNotCorrupted)
|
||||
{
|
||||
TempDir dir;
|
||||
std::string largeContent(8192, 'x');
|
||||
dir.WriteFile(L"large.json", largeContent);
|
||||
|
||||
Assert::IsFalse(updating::IsJsonFileCorrupted(dir.path() / L"large.json"));
|
||||
}
|
||||
|
||||
// Tests IsJsonFileCorrupted: null byte placed after the first 4096-byte
|
||||
// chunk boundary is still detected.
|
||||
// Covers: configBackup.h IsJsonFileCorrupted — second chunk scan.
|
||||
TEST_METHOD(NullByteAtEndOfLargeFileIsDetected)
|
||||
{
|
||||
TempDir dir;
|
||||
std::string content(5000, 'x');
|
||||
content[4999] = '\0';
|
||||
std::vector<char> bytes(content.begin(), content.end());
|
||||
dir.WriteFileBytes(L"sneaky.json", bytes);
|
||||
|
||||
Assert::IsTrue(updating::IsJsonFileCorrupted(dir.path() / L"sneaky.json"));
|
||||
}
|
||||
};
|
||||
|
||||
TEST_CLASS(BackupConfigFilesTests)
|
||||
{
|
||||
public:
|
||||
// Tests BackupConfigFiles: root-level .json files are copied to ConfigBackup.
|
||||
// Covers: configBackup.h BackupConfigFiles — root directory_iterator,
|
||||
// is_regular_file && extension == ".json" branch.
|
||||
// Setup: Two root-level JSON files.
|
||||
TEST_METHOD(BackupCopiesRootJsonFiles)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"theme":"dark"})");
|
||||
dir.WriteFile(L"UpdateState.json", R"({"state":0})");
|
||||
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\settings.json"));
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\UpdateState.json"));
|
||||
Assert::AreEqual(std::string(R"({"theme":"dark"})"), dir.ReadFile(L"ConfigBackup\\settings.json"));
|
||||
}
|
||||
|
||||
// Tests BackupConfigFiles: .json files inside module subdirectories are
|
||||
// copied to ConfigBackup/<module>/.
|
||||
// Covers: configBackup.h BackupConfigFiles — is_directory branch,
|
||||
// module directory_iterator with extension filter.
|
||||
// Setup: Root JSON + two module directories with JSON files.
|
||||
TEST_METHOD(BackupCopiesModuleJsonFiles)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"theme":"dark"})");
|
||||
dir.WriteFile(L"FancyZones\\settings.json", R"({"zones":[]})");
|
||||
dir.WriteFile(L"Workspaces\\workspaces.json", R"({"workspaces":[]})");
|
||||
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\FancyZones\\settings.json"));
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\Workspaces\\workspaces.json"));
|
||||
Assert::AreEqual(std::string(R"({"zones":[]})"),
|
||||
dir.ReadFile(L"ConfigBackup\\FancyZones\\settings.json"));
|
||||
}
|
||||
|
||||
// Tests BackupConfigFiles: non-.json files at root level are not copied.
|
||||
// Covers: configBackup.h BackupConfigFiles — extension filter excludes .log.
|
||||
// Setup: One JSON file + one .log file at root.
|
||||
TEST_METHOD(BackupSkipsNonJsonFiles)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"theme":"dark"})");
|
||||
dir.WriteFile(L"debug.log", "log data");
|
||||
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\settings.json"));
|
||||
Assert::IsFalse(dir.FileExists(L"ConfigBackup\\debug.log"));
|
||||
}
|
||||
|
||||
// Tests BackupConfigFiles: the "Updates" directory is explicitly skipped.
|
||||
// Covers: configBackup.h BackupConfigFiles — dirName == L"Updates" continue.
|
||||
// Setup: Root JSON + Updates directory containing a file.
|
||||
TEST_METHOD(BackupSkipsUpdatesDirectory)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"theme":"dark"})");
|
||||
dir.WriteFile(L"Updates\\installer.exe", "fake exe");
|
||||
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
Assert::IsFalse(dir.FileExists(L"ConfigBackup\\Updates"));
|
||||
}
|
||||
|
||||
// Tests BackupConfigFiles: running backup twice overwrites the previous
|
||||
// backup with current file content.
|
||||
// Covers: configBackup.h BackupConfigFiles — fs::remove_all(backupDir) +
|
||||
// copy_options::overwrite_existing.
|
||||
// Setup: Backup, modify original, backup again.
|
||||
TEST_METHOD(BackupOverwritesPreviousBackup)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"version":1})");
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// Update the original
|
||||
dir.WriteFile(L"settings.json", R"({"version":2})");
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
Assert::AreEqual(std::string(R"({"version":2})"), dir.ReadFile(L"ConfigBackup\\settings.json"));
|
||||
}
|
||||
|
||||
// Tests BackupConfigFiles: non-.json files inside module subdirectories
|
||||
// (e.g., FancyZones/zones.dat) should NOT be backed up.
|
||||
// Covers: configBackup.h BackupConfigFiles — extension filter in module loop.
|
||||
TEST_METHOD(BackupSkipsNonJsonFilesInModuleDirs)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({})");
|
||||
dir.WriteFile(L"FancyZones\\settings.json", R"({"zones":[]})");
|
||||
dir.WriteFile(L"FancyZones\\zones.dat", "binary data");
|
||||
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\FancyZones\\settings.json"));
|
||||
Assert::IsFalse(dir.FileExists(L"ConfigBackup\\FancyZones\\zones.dat"));
|
||||
}
|
||||
|
||||
// Tests BackupConfigFiles: empty root directory with no files produces
|
||||
// an empty ConfigBackup dir without errors.
|
||||
// Covers: configBackup.h BackupConfigFiles — empty directory_iterator.
|
||||
TEST_METHOD(BackupEmptyRootDirSucceeds)
|
||||
{
|
||||
TempDir dir;
|
||||
// Root dir exists but has no files
|
||||
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup"));
|
||||
}
|
||||
};
|
||||
|
||||
TEST_CLASS(RestoreCorruptedConfigsTests)
|
||||
{
|
||||
public:
|
||||
// Tests RestoreCorruptedConfigs: corrupted root-level JSON file is restored
|
||||
// from the good backup copy.
|
||||
// Covers: configBackup.h RestoreCorruptedConfigs — root file restore branch,
|
||||
// fs::exists + IsJsonFileCorrupted + backup integrity check.
|
||||
// Setup: Good file -> backup -> corrupt original -> restore.
|
||||
TEST_METHOD(RestoreFixesCorruptedRootFile)
|
||||
{
|
||||
TempDir dir;
|
||||
const std::string goodContent = R"({"theme":"dark"})";
|
||||
dir.WriteFile(L"settings.json", goodContent);
|
||||
|
||||
// Backup
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// Corrupt the original
|
||||
std::vector<char> corrupted(goodContent.size(), '\0');
|
||||
dir.WriteFileBytes(L"settings.json", corrupted);
|
||||
Assert::IsTrue(updating::IsJsonFileCorrupted(dir.path() / L"settings.json"));
|
||||
|
||||
// Restore
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
Assert::IsFalse(updating::IsJsonFileCorrupted(dir.path() / L"settings.json"));
|
||||
Assert::AreEqual(goodContent, dir.ReadFile(L"settings.json"));
|
||||
}
|
||||
|
||||
// Tests RestoreCorruptedConfigs: corrupted module-level JSON file is restored
|
||||
// from the good backup copy.
|
||||
// Covers: configBackup.h RestoreCorruptedConfigs — module directory branch,
|
||||
// moduleBackupEntry restore with integrity check.
|
||||
// Setup: Module file + root file -> backup -> corrupt module file -> restore.
|
||||
TEST_METHOD(RestoreFixesCorruptedModuleFile)
|
||||
{
|
||||
TempDir dir;
|
||||
const std::string goodContent = R"({"workspaces":[]})";
|
||||
dir.WriteFile(L"Workspaces\\workspaces.json", goodContent);
|
||||
dir.WriteFile(L"settings.json", R"({})");
|
||||
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// Corrupt the module file
|
||||
std::vector<char> corrupted(goodContent.size(), '\0');
|
||||
dir.WriteFileBytes(L"Workspaces\\workspaces.json", corrupted);
|
||||
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
Assert::AreEqual(goodContent, dir.ReadFile(L"Workspaces\\workspaces.json"));
|
||||
}
|
||||
|
||||
// Tests RestoreCorruptedConfigs: clean (non-corrupted) files are NOT
|
||||
// overwritten by backup — preserves user changes made after backup.
|
||||
// Covers: configBackup.h RestoreCorruptedConfigs — IsJsonFileCorrupted
|
||||
// returns false, copy_file is skipped.
|
||||
// Setup: File -> backup -> modify (but keep valid) -> restore.
|
||||
TEST_METHOD(RestoreLeavesCleanFilesUntouched)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"version":1})");
|
||||
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// Modify original (but keep it clean JSON)
|
||||
dir.WriteFile(L"settings.json", R"({"version":2})");
|
||||
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
// Should NOT have been restored since it's not corrupted
|
||||
Assert::AreEqual(std::string(R"({"version":2})"), dir.ReadFile(L"settings.json"));
|
||||
}
|
||||
|
||||
// Tests RestoreCorruptedConfigs: when no ConfigBackup directory exists,
|
||||
// restore silently does nothing (no crash, no data loss).
|
||||
// Covers: configBackup.h RestoreCorruptedConfigs — !fs::exists(backupDir)
|
||||
// early return.
|
||||
// Setup: File with no prior backup.
|
||||
TEST_METHOD(RestoreHandlesMissingBackupDirectory)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"theme":"dark"})");
|
||||
|
||||
// No backup was created - restore should silently do nothing
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
Assert::AreEqual(std::string(R"({"theme":"dark"})"), dir.ReadFile(L"settings.json"));
|
||||
}
|
||||
|
||||
// Tests RestoreCorruptedConfigs: end-to-end scenario with multiple modules,
|
||||
// some corrupted and some clean, verifying selective restore.
|
||||
// Covers: configBackup.h RestoreCorruptedConfigs — both root and module
|
||||
// branches, selective restore based on corruption status.
|
||||
// Setup: 4 modules -> backup -> corrupt 2 -> restore -> verify all 4.
|
||||
TEST_METHOD(FullBackupAndRestoreRoundTrip)
|
||||
{
|
||||
TempDir dir;
|
||||
|
||||
// Set up a realistic config structure
|
||||
dir.WriteFile(L"settings.json", R"({"startup":true,"theme":"dark"})");
|
||||
dir.WriteFile(L"FancyZones\\settings.json", R"({"zones":[{"id":1}]})");
|
||||
dir.WriteFile(L"Workspaces\\workspaces.json", R"({"workspaces":[{"name":"dev"}]})");
|
||||
dir.WriteFile(L"KeyboardManager\\default.json", R"({"remaps":[]})");
|
||||
|
||||
// Backup
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// Corrupt some files (simulating #46179 scenario)
|
||||
dir.WriteFileBytes(L"Workspaces\\workspaces.json", std::vector<char>(100, '\0'));
|
||||
dir.WriteFileBytes(L"settings.json", std::vector<char>(50, '\0'));
|
||||
// Leave FancyZones and KBM clean
|
||||
|
||||
// Restore
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
// Corrupted files should be restored
|
||||
Assert::AreEqual(std::string(R"({"startup":true,"theme":"dark"})"), dir.ReadFile(L"settings.json"));
|
||||
Assert::AreEqual(std::string(R"({"workspaces":[{"name":"dev"}]})"), dir.ReadFile(L"Workspaces\\workspaces.json"));
|
||||
|
||||
// Clean files should be unchanged
|
||||
Assert::AreEqual(std::string(R"({"zones":[{"id":1}]})"), dir.ReadFile(L"FancyZones\\settings.json"));
|
||||
Assert::AreEqual(std::string(R"({"remaps":[]})"), dir.ReadFile(L"KeyboardManager\\default.json"));
|
||||
}
|
||||
|
||||
// Tests RestoreCorruptedConfigs: when the original file has been deleted
|
||||
// (not corrupted), restore should NOT recreate it from backup. The installer
|
||||
// may have intentionally removed obsolete config files.
|
||||
// Covers: configBackup.h RestoreCorruptedConfigs — fs::exists guard.
|
||||
TEST_METHOD(RestoreSkipsDeletedOriginals)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"obsolete.json", R"({"old":true})");
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// Installer deletes the file
|
||||
std::error_code ec;
|
||||
fs::remove(dir.path() / L"obsolete.json", ec);
|
||||
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
// Should NOT be recreated
|
||||
Assert::IsFalse(dir.FileExists(L"obsolete.json"));
|
||||
}
|
||||
|
||||
// Tests RestoreCorruptedConfigs: when the backup file itself is corrupted
|
||||
// (e.g., disk error during backup), restore should NOT copy corrupted
|
||||
// backup over the original — that would make things worse.
|
||||
// Covers: configBackup.h RestoreCorruptedConfigs — backup integrity check (B2 fix).
|
||||
TEST_METHOD(RestoreSkipsCorruptedBackup)
|
||||
{
|
||||
TempDir dir;
|
||||
dir.WriteFile(L"settings.json", R"({"theme":"dark"})");
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// Corrupt BOTH the original AND the backup
|
||||
std::vector<char> nulls(50, '\0');
|
||||
dir.WriteFileBytes(L"settings.json", nulls);
|
||||
dir.WriteFileBytes(L"ConfigBackup\\settings.json", nulls);
|
||||
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
// Original should still be corrupted — we don't restore from bad backup
|
||||
Assert::IsTrue(updating::IsJsonFileCorrupted(dir.path() / L"settings.json"));
|
||||
}
|
||||
};
|
||||
|
||||
// Simulates what actually happens during a PowerToys upgrade:
|
||||
// 1. User has settings from normal use
|
||||
// 2. Updater backs up before install (Stage 1)
|
||||
// 3. Installer runs and corrupts some files (simulated)
|
||||
// 4. Updater restores corrupted files (Stage 2)
|
||||
// 5. PT relaunches and finds working configs
|
||||
TEST_CLASS(UpgradeSimulationTests)
|
||||
{
|
||||
public:
|
||||
// Tests full upgrade simulation: backup -> installer corrupts files -> restore.
|
||||
// Verifies that corrupted files are restored and clean files are untouched.
|
||||
// Covers: configBackup.h BackupConfigFiles + RestoreCorruptedConfigs —
|
||||
// end-to-end with 5 modules, 2 corrupted, 3 clean.
|
||||
// Setup: Realistic config structure with multiple modules.
|
||||
TEST_METHOD(SimulateUpgradeWithCorruption)
|
||||
{
|
||||
TempDir dir;
|
||||
|
||||
// === User's real config state before upgrade ===
|
||||
dir.WriteFile(L"settings.json",
|
||||
R"({"startup":true,"theme":"dark","run_elevated":false,"download_updates_automatically":true})");
|
||||
dir.WriteFile(L"FancyZones\\settings.json",
|
||||
R"({"zones":[{"id":1,"rect":{"x":0,"y":0,"w":960,"h":1080}}]})");
|
||||
dir.WriteFile(L"Workspaces\\workspaces.json",
|
||||
R"({"workspaces":[{"name":"dev","apps":["code","terminal"]}]})");
|
||||
dir.WriteFile(L"KeyboardManager\\default.json",
|
||||
R"({"remapKeys":{"inProcess":[{"original":"0x41","new":"0x42"}]}})");
|
||||
dir.WriteFile(L"MouseWithoutBorders\\settings.json",
|
||||
R"({"machineKey":"abc123","connectToAll":true})");
|
||||
|
||||
// Non-JSON files that should be left alone
|
||||
dir.WriteFile(L"update.log", "2026-04-11 update started");
|
||||
|
||||
// === Stage 1: Backup before killing PT ===
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// Verify backup was created correctly
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\settings.json"));
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\FancyZones\\settings.json"));
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\Workspaces\\workspaces.json"));
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\KeyboardManager\\default.json"));
|
||||
Assert::IsTrue(dir.FileExists(L"ConfigBackup\\MouseWithoutBorders\\settings.json"));
|
||||
Assert::IsFalse(dir.FileExists(L"ConfigBackup\\update.log"));
|
||||
|
||||
// === Installer runs: some files get corrupted (the #46179 scenario) ===
|
||||
// Workspaces JSON filled with null bytes
|
||||
dir.WriteFileBytes(L"Workspaces\\workspaces.json", std::vector<char>(512, '\0'));
|
||||
// Main settings partially corrupted (null bytes injected)
|
||||
std::vector<char> partialCorrupt = { '{', '"', 's', '\0', '\0', '\0', '\0', '}' };
|
||||
dir.WriteFileBytes(L"settings.json", partialCorrupt);
|
||||
|
||||
// FancyZones, KBM, and MWB survive the install fine
|
||||
// (this is realistic - not all files get corrupted)
|
||||
|
||||
// === Stage 2: Restore after install completes ===
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
// === Verify: PT relaunches and finds working configs ===
|
||||
|
||||
// Corrupted files should be restored from backup
|
||||
Assert::IsFalse(updating::IsJsonFileCorrupted(dir.path() / L"settings.json"));
|
||||
Assert::IsFalse(updating::IsJsonFileCorrupted(dir.path() / L"Workspaces\\workspaces.json"));
|
||||
Assert::AreEqual(
|
||||
std::string(R"({"startup":true,"theme":"dark","run_elevated":false,"download_updates_automatically":true})"),
|
||||
dir.ReadFile(L"settings.json"));
|
||||
Assert::AreEqual(
|
||||
std::string(R"({"workspaces":[{"name":"dev","apps":["code","terminal"]}]})"),
|
||||
dir.ReadFile(L"Workspaces\\workspaces.json"));
|
||||
|
||||
// Clean files should be untouched (not overwritten with backup)
|
||||
Assert::AreEqual(
|
||||
std::string(R"({"zones":[{"id":1,"rect":{"x":0,"y":0,"w":960,"h":1080}}]})"),
|
||||
dir.ReadFile(L"FancyZones\\settings.json"));
|
||||
Assert::AreEqual(
|
||||
std::string(R"({"remapKeys":{"inProcess":[{"original":"0x41","new":"0x42"}]}})"),
|
||||
dir.ReadFile(L"KeyboardManager\\default.json"));
|
||||
Assert::AreEqual(
|
||||
std::string(R"({"machineKey":"abc123","connectToAll":true})"),
|
||||
dir.ReadFile(L"MouseWithoutBorders\\settings.json"));
|
||||
}
|
||||
|
||||
// Tests upgrade from an old version that has fewer modules than the new version.
|
||||
// Verifies that new module configs (created by the installer) are not touched
|
||||
// by restore, while corrupted old configs are restored.
|
||||
// Covers: configBackup.h RestoreCorruptedConfigs — module dir in root that
|
||||
// has no corresponding backup entry.
|
||||
// Setup: Old version with 1 module -> backup -> new installer adds module -> corrupt old -> restore.
|
||||
TEST_METHOD(SimulateUpgradeFromVeryOldVersion)
|
||||
{
|
||||
TempDir dir;
|
||||
|
||||
// Old version had fewer modules - only settings.json
|
||||
dir.WriteFile(L"settings.json", R"({"theme":"dark","powertoys_version":"v0.60.0"})");
|
||||
|
||||
// Backup
|
||||
updating::BackupConfigFiles(dir.path());
|
||||
|
||||
// New installer creates new module dirs that didn't exist before
|
||||
dir.WriteFile(L"NewModule\\settings.json", R"({"enabled":true})");
|
||||
|
||||
// Old settings get corrupted during upgrade
|
||||
dir.WriteFileBytes(L"settings.json", std::vector<char>(100, '\0'));
|
||||
|
||||
// Restore
|
||||
updating::RestoreCorruptedConfigs(dir.path());
|
||||
|
||||
// Old settings restored
|
||||
Assert::AreEqual(
|
||||
std::string(R"({"theme":"dark","powertoys_version":"v0.60.0"})"),
|
||||
dir.ReadFile(L"settings.json"));
|
||||
|
||||
// New module settings untouched (no backup existed for them)
|
||||
Assert::AreEqual(
|
||||
std::string(R"({"enabled":true})"),
|
||||
dir.ReadFile(L"NewModule\\settings.json"));
|
||||
}
|
||||
};
|
||||
|
||||
// Tests for the update lifecycle: argument passing between Stage 1 and Stage 2,
|
||||
// relaunch path construction, and the handoff that was broken in #42004/#43011/#44071.
|
||||
TEST_CLASS(UpdateLifecycleTests)
|
||||
{
|
||||
public:
|
||||
// Tests BuildStage2Arguments: output contains the stage 2 flag, installer path,
|
||||
// and install directory — all three components needed for Stage 2.
|
||||
// Covers: updateLifecycle.h BuildStage2Arguments — concatenation logic.
|
||||
// Setup: Typical paths with spaces (Program Files).
|
||||
TEST_METHOD(BuildStage2ArgumentsContainsInstallerAndInstallDir)
|
||||
{
|
||||
const auto args = updating::BuildStage2Arguments(
|
||||
L"-update_now_stage_2",
|
||||
L"C:\\Users\\test\\AppData\\Local\\PowerToys\\Updates\\powertoyssetup-x64.exe",
|
||||
L"C:\\Program Files\\PowerToys");
|
||||
|
||||
// Must contain the stage 2 flag
|
||||
Assert::IsTrue(args.find(L"-update_now_stage_2") != std::wstring::npos);
|
||||
// Must contain the installer path (quoted)
|
||||
Assert::IsTrue(args.find(L"powertoyssetup-x64.exe") != std::wstring::npos);
|
||||
// Must contain the install directory (quoted) — this was MISSING before our fix
|
||||
Assert::IsTrue(args.find(L"C:\\Program Files\\PowerToys") != std::wstring::npos);
|
||||
}
|
||||
|
||||
// Tests BuildStage2Arguments: both paths are wrapped in double quotes to
|
||||
// survive CommandLineToArgvW parsing when paths contain spaces.
|
||||
// Covers: updateLifecycle.h BuildStage2Arguments — quote wrapping.
|
||||
// Setup: Installer path with spaces.
|
||||
TEST_METHOD(BuildStage2ArgumentsQuotesBothPaths)
|
||||
{
|
||||
const auto args = updating::BuildStage2Arguments(
|
||||
L"-update_now_stage_2",
|
||||
L"C:\\path with spaces\\installer.exe",
|
||||
L"C:\\Program Files\\PowerToys");
|
||||
|
||||
// Count quotes — should have 4 (open/close for each path)
|
||||
size_t quoteCount = std::count(args.begin(), args.end(), L'"');
|
||||
Assert::AreEqual(size_t{ 4 }, quoteCount);
|
||||
}
|
||||
|
||||
// Tests BuildPowerToysExePath: appends "PowerToys.exe" to the install dir.
|
||||
// Covers: updateLifecycle.h BuildPowerToysExePath — fs::path / operator.
|
||||
// Setup: Standard install path without trailing backslash.
|
||||
TEST_METHOD(BuildPowerToysExePathAppendsExeName)
|
||||
{
|
||||
const auto path = updating::BuildPowerToysExePath(L"C:\\Program Files\\PowerToys");
|
||||
Assert::AreEqual(std::wstring(L"C:\\Program Files\\PowerToys\\PowerToys.exe"), path);
|
||||
}
|
||||
|
||||
// Tests BuildPowerToysExePath: trailing backslash does not produce double
|
||||
// backslash (e.g., "...PowerToys\\PowerToys.exe").
|
||||
// Covers: updateLifecycle.h BuildPowerToysExePath — fs::path normalizes separators.
|
||||
// Setup: Install path with trailing backslash.
|
||||
TEST_METHOD(BuildPowerToysExePathHandlesTrailingBackslash)
|
||||
{
|
||||
const auto path = updating::BuildPowerToysExePath(L"C:\\Program Files\\PowerToys\\");
|
||||
Assert::AreEqual(std::wstring(L"C:\\Program Files\\PowerToys\\PowerToys.exe"), path);
|
||||
}
|
||||
|
||||
// Tests BuildPowerToysExePath: empty string produces just "PowerToys.exe".
|
||||
// Covers: updateLifecycle.h BuildPowerToysExePath — fs::path with empty input.
|
||||
// Setup: Empty install directory string.
|
||||
TEST_METHOD(BuildPowerToysExePathHandlesEmptyString)
|
||||
{
|
||||
const auto path = updating::BuildPowerToysExePath(L"");
|
||||
Assert::AreEqual(std::wstring(L"PowerToys.exe"), path);
|
||||
}
|
||||
|
||||
// Tests CanRelaunchAfterUpdate: returns true when Stage 2 receives
|
||||
// the install directory (argCount >= 4), false otherwise.
|
||||
// This is the gate that prevents relaunch when using an old Stage 1
|
||||
// that didn't pass the install dir (#42004/#43011/#44071).
|
||||
// Covers: updateLifecycle.h CanRelaunchAfterUpdate.
|
||||
TEST_METHOD(CanRelaunchReflectsArgCount)
|
||||
{
|
||||
// Old Stage 1 (pre-fix): only passed action + installer = 3 args
|
||||
Assert::IsFalse(updating::CanRelaunchAfterUpdate(0));
|
||||
Assert::IsFalse(updating::CanRelaunchAfterUpdate(1));
|
||||
Assert::IsFalse(updating::CanRelaunchAfterUpdate(2));
|
||||
Assert::IsFalse(updating::CanRelaunchAfterUpdate(3));
|
||||
|
||||
// New Stage 1 (post-fix): passes action + installer + installDir = 4 args
|
||||
Assert::IsTrue(updating::CanRelaunchAfterUpdate(4));
|
||||
Assert::IsTrue(updating::CanRelaunchAfterUpdate(5));
|
||||
}
|
||||
|
||||
// Tests BuildStage2Arguments + CommandLineToArgvW round-trip: the exact
|
||||
// scenario where Stage 1 builds args and Windows parses them in Stage 2.
|
||||
// Verifies quoting is correct so paths with spaces survive the round trip.
|
||||
// Covers: updateLifecycle.h BuildStage2Arguments — quote correctness.
|
||||
// Setup: Realistic paths with spaces and version numbers.
|
||||
TEST_METHOD(Stage2ArgumentsCanBeRoundTrippedThroughCommandLineToArgvW)
|
||||
{
|
||||
const std::wstring installerPath = L"C:\\Users\\test user\\AppData\\Local\\PowerToys\\Updates\\powertoyssetup-0.86.0-x64.exe";
|
||||
const std::wstring installDir = L"C:\\Program Files\\PowerToys";
|
||||
|
||||
const auto args = updating::BuildStage2Arguments(L"-update_now_stage_2", installerPath, installDir);
|
||||
|
||||
// Simulate what Windows does: prepend a fake exe name and parse
|
||||
std::wstring commandLine = L"PowerToys.Update.exe " + args;
|
||||
|
||||
int argc = 0;
|
||||
LPWSTR* argv = CommandLineToArgvW(commandLine.c_str(), &argc);
|
||||
Assert::IsNotNull(argv);
|
||||
Assert::AreEqual(4, argc);
|
||||
Assert::AreEqual(std::wstring(L"-update_now_stage_2"), std::wstring(argv[1]));
|
||||
Assert::AreEqual(installerPath, std::wstring(argv[2]));
|
||||
Assert::AreEqual(installDir, std::wstring(argv[3]));
|
||||
|
||||
LocalFree(argv);
|
||||
}
|
||||
};
|
||||
}
|
||||
45
src/common/updating/UnitTests/UpdatingUnitTests.vcxproj
Normal file
45
src/common/updating/UnitTests/UpdatingUnitTests.vcxproj
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<ProjectGuid>{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>UpdatingUnitTests</RootNamespace>
|
||||
<ProjectSubType>NativeUnitTestProject</ProjectSubType>
|
||||
<ProjectName>Updating.UnitTests</ProjectName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\tests\UpdatingUnitTests\</OutDir>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\;..\..\;..\..\..\;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="UpdatingTests.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
||||
5
src/common/updating/UnitTests/pch.cpp
Normal file
5
src/common/updating/UnitTests/pch.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#include "pch.h"
|
||||
17
src/common/updating/UnitTests/pch.h
Normal file
17
src/common/updating/UnitTests/pch.h
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#ifndef PCH_H
|
||||
#define PCH_H
|
||||
|
||||
#include <atomic>
|
||||
#include <Windows.h>
|
||||
|
||||
// Suppressing 26466 - Don't use static_cast downcasts - in CppUnitTest.h
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 26466)
|
||||
#include "CppUnitTest.h"
|
||||
#pragma warning(pop)
|
||||
|
||||
#endif //PCH_H
|
||||
170
src/common/updating/configBackup.h
Normal file
170
src/common/updating/configBackup.h
Normal file
@@ -0,0 +1,170 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
namespace updating
|
||||
{
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
// Check if a JSON file is corrupted (contains null bytes, as seen in #46179)
|
||||
inline bool IsJsonFileCorrupted(const fs::path& filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
std::ifstream file(filePath, std::ios::binary);
|
||||
if (!file.is_open())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
constexpr size_t c_readChunkSize{ 4096 };
|
||||
char buffer[c_readChunkSize];
|
||||
while (file.read(buffer, c_readChunkSize) || file.gcount() > 0)
|
||||
{
|
||||
const auto bytesRead = file.gcount();
|
||||
for (std::streamsize i = 0; i < bytesRead; ++i)
|
||||
{
|
||||
if (buffer[i] == '\0')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Backup all JSON config files before update to protect against corruption (#46179)
|
||||
inline void BackupConfigFiles(const fs::path& rootPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
const fs::path backupDir = rootPath / L"ConfigBackup";
|
||||
|
||||
std::error_code ec;
|
||||
fs::remove_all(backupDir, ec);
|
||||
// Note: remove_all failure means stale backup may persist; continue anyway
|
||||
// since create_directories will overlay
|
||||
fs::create_directories(backupDir, ec);
|
||||
if (ec)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& entry : fs::directory_iterator(rootPath, ec))
|
||||
{
|
||||
if (ec)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (entry.is_regular_file() && entry.path().extension() == L".json")
|
||||
{
|
||||
fs::copy_file(entry.path(), backupDir / entry.path().filename(), fs::copy_options::overwrite_existing, ec);
|
||||
}
|
||||
else if (entry.is_directory())
|
||||
{
|
||||
const auto dirName = entry.path().filename().wstring();
|
||||
if (dirName == L"ConfigBackup" || dirName == L"Updates")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto moduleBackup = backupDir / entry.path().filename();
|
||||
fs::create_directories(moduleBackup, ec);
|
||||
|
||||
std::error_code moduleEc;
|
||||
for (const auto& moduleEntry : fs::directory_iterator(entry.path(), moduleEc))
|
||||
{
|
||||
if (moduleEc)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (moduleEntry.is_regular_file() && moduleEntry.path().extension() == L".json")
|
||||
{
|
||||
fs::copy_file(moduleEntry.path(), moduleBackup / moduleEntry.path().filename(), fs::copy_options::overwrite_existing, moduleEc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// Intentionally swallowed — update must not fail due to backup errors.
|
||||
// Logging would require spdlog dependency which is unavailable in test context.
|
||||
}
|
||||
}
|
||||
|
||||
// Restore JSON configs from backup if corruption is detected after update
|
||||
inline void RestoreCorruptedConfigs(const fs::path& rootPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
const fs::path backupDir = rootPath / L"ConfigBackup";
|
||||
|
||||
if (!fs::exists(backupDir))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::error_code ec;
|
||||
for (const auto& backupEntry : fs::directory_iterator(backupDir, ec))
|
||||
{
|
||||
if (ec)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (backupEntry.is_regular_file() && backupEntry.path().extension() == L".json")
|
||||
{
|
||||
const auto originalPath = rootPath / backupEntry.path().filename();
|
||||
// Only restore if the backup itself is valid
|
||||
if (fs::exists(originalPath) && IsJsonFileCorrupted(originalPath) && !IsJsonFileCorrupted(backupEntry.path()))
|
||||
{
|
||||
fs::copy_file(backupEntry.path(), originalPath, fs::copy_options::overwrite_existing, ec);
|
||||
}
|
||||
}
|
||||
else if (backupEntry.is_directory())
|
||||
{
|
||||
const auto moduleDir = rootPath / backupEntry.path().filename();
|
||||
|
||||
std::error_code moduleEc;
|
||||
for (const auto& moduleBackupEntry : fs::directory_iterator(backupEntry.path(), moduleEc))
|
||||
{
|
||||
if (moduleEc)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (moduleBackupEntry.is_regular_file() && moduleBackupEntry.path().extension() == L".json")
|
||||
{
|
||||
const auto originalModulePath = moduleDir / moduleBackupEntry.path().filename();
|
||||
// Only restore if the backup itself is valid
|
||||
if (fs::exists(originalModulePath) && IsJsonFileCorrupted(originalModulePath) && !IsJsonFileCorrupted(moduleBackupEntry.path()))
|
||||
{
|
||||
fs::copy_file(moduleBackupEntry.path(), originalModulePath, fs::copy_options::overwrite_existing, moduleEc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// Intentionally swallowed — update must not fail due to backup errors.
|
||||
// Logging would require spdlog dependency which is unavailable in test context.
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/common/updating/updateLifecycle.h
Normal file
47
src/common/updating/updateLifecycle.h
Normal file
@@ -0,0 +1,47 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
namespace updating
|
||||
{
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
// Build the command-line arguments for Stage 2.
|
||||
// Stage 1 passes the installer path and the PT install directory
|
||||
// so Stage 2 can run the installer and relaunch PowerToys afterward.
|
||||
// Note: paths containing embedded double-quote characters are not supported.
|
||||
// This is safe because install paths come from get_module_folderpath().
|
||||
inline std::wstring BuildStage2Arguments(
|
||||
const std::wstring& stage2Flag,
|
||||
const fs::path& installerPath,
|
||||
const fs::path& installDir)
|
||||
{
|
||||
std::wstring arguments{ stage2Flag };
|
||||
arguments += L" \"";
|
||||
arguments += installerPath.c_str();
|
||||
arguments += L"\" \"";
|
||||
arguments += installDir.c_str();
|
||||
arguments += L"\"";
|
||||
return arguments;
|
||||
}
|
||||
|
||||
// Build the full path to PowerToys.exe from the install directory.
|
||||
// Used by Stage 2 to relaunch PT after a successful update.
|
||||
inline std::wstring BuildPowerToysExePath(const std::wstring& installDir)
|
||||
{
|
||||
return (std::filesystem::path(installDir) / L"PowerToys.exe").wstring();
|
||||
}
|
||||
|
||||
// Determine whether Stage 2 has enough information to relaunch PT.
|
||||
// Returns true if the install directory argument was provided.
|
||||
inline bool CanRelaunchAfterUpdate(int argCount)
|
||||
{
|
||||
// args[0]=exe, args[1]=action, args[2]=installer, args[3]=installDir
|
||||
return argCount >= 4;
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class BaseDscTest
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the resource string.</param>
|
||||
/// <param name="args">The arguments to format the resource string with.</param>
|
||||
/// <returns></returns>
|
||||
/// <returns>The formatted resource string.</returns>
|
||||
public string GetResourceString(string name, params string[] args)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, _resourceManager.GetString(name, CultureInfo.InvariantCulture), args);
|
||||
@@ -35,9 +35,9 @@ public class BaseDscTest
|
||||
/// <summary>
|
||||
/// Execute a dsc command with the provided arguments.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
/// <typeparam name="T">The type of the DSC command to execute.</typeparam>
|
||||
/// <param name="args">The command-line arguments to pass to the DSC command.</param>
|
||||
/// <returns>The result of the DSC command execution.</returns>
|
||||
protected DscExecuteResult ExecuteDscCommand<T>(params string[] args)
|
||||
where T : Command, new()
|
||||
{
|
||||
|
||||
@@ -47,6 +47,6 @@ public interface ISettingsFunctionData
|
||||
/// <summary>
|
||||
/// Gets the schema for the settings resource object.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <returns>The JSON schema string for the settings resource object.</returns>
|
||||
public string Schema();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class BaseResourceObject
|
||||
/// <summary>
|
||||
/// Generates a JSON representation of the resource object.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <returns>A JSON representation of the resource object.</returns>
|
||||
public JsonNode ToJson()
|
||||
{
|
||||
return JsonSerializer.SerializeToNode(this, GetType(), _options) ?? new JsonObject();
|
||||
|
||||
@@ -150,7 +150,6 @@
|
||||
<decimal value="0" />
|
||||
</disabledValue>
|
||||
</policy>
|
||||
<!-- TEMPORARILY_DISABLED: PowerDisplay
|
||||
<policy name="ConfigureEnabledUtilityPowerDisplay" class="Both" displayName="$(string.ConfigureEnabledUtilityPowerDisplay)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityPowerDisplay">
|
||||
<parentCategory ref="PowerToys" />
|
||||
<supportedOn ref="SUPPORTED_POWERTOYS_0_95_0" />
|
||||
@@ -161,7 +160,6 @@
|
||||
<decimal value="0" />
|
||||
</disabledValue>
|
||||
</policy>
|
||||
-->
|
||||
<policy name="ConfigureEnabledUtilityEnvironmentVariables" class="Both" displayName="$(string.ConfigureEnabledUtilityEnvironmentVariables)" explainText="$(string.ConfigureEnabledUtilityDescription)" key="Software\Policies\PowerToys" valueName="ConfigureEnabledUtilityEnvironmentVariables">
|
||||
<parentCategory ref="PowerToys" />
|
||||
<supportedOn ref="SUPPORTED_POWERTOYS_0_75_0" />
|
||||
|
||||
@@ -249,7 +249,7 @@ If you don't configure this policy, the user will be able to control the setting
|
||||
<string id="ConfigureEnabledUtilityCmdPal">CmdPal: Configure enabled state</string>
|
||||
<string id="ConfigureEnabledUtilityCropAndLock">Crop And Lock: Configure enabled state</string>
|
||||
<string id="ConfigureEnabledUtilityLightSwitch">Light Switch: Configure enabled state</string>
|
||||
<!-- <string id="ConfigureEnabledUtilityPowerDisplay">PowerDisplay: Configure enabled state</string> --><!-- TEMPORARILY_DISABLED: PowerDisplay -->
|
||||
<string id="ConfigureEnabledUtilityPowerDisplay">PowerDisplay: Configure enabled state</string>
|
||||
<string id="ConfigureEnabledUtilityEnvironmentVariables">Environment Variables: Configure enabled state</string>
|
||||
<string id="ConfigureEnabledUtilityFancyZones">FancyZones: Configure enabled state</string>
|
||||
<string id="ConfigureEnabledUtilityFileLocksmith">File Locksmith: Configure enabled state</string>
|
||||
|
||||
@@ -70,12 +70,12 @@
|
||||
Spacing="2">
|
||||
<TextBlock
|
||||
Style="{StaticResource BodyTextBlockStyle}"
|
||||
Text="{x:Bind Header, Mode=OneWay}"
|
||||
Text="{x:Bind Header, Mode=OneTime}"
|
||||
TextWrapping="NoWrap" />
|
||||
<TextBlock
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind Timestamp, Converter={StaticResource DateTimeToFriendlyStringConverter}, Mode=OneWay}" />
|
||||
Text="{x:Bind Timestamp, Converter={StaticResource DateTimeToFriendlyStringConverter}, Mode=OneTime}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -29,31 +29,31 @@
|
||||
Padding="-9,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
AutomationProperties.AcceleratorKey="{x:Bind ShortcutText, Mode=OneWay}"
|
||||
AutomationProperties.AcceleratorKey="{x:Bind ShortcutText, Mode=OneTime}"
|
||||
AutomationProperties.AutomationControlType="ListItem"
|
||||
AutomationProperties.FullDescription="{x:Bind ToolTip, Mode=OneWay}"
|
||||
AutomationProperties.HelpText="{x:Bind Name, Mode=OneWay}"
|
||||
AutomationProperties.Name="{x:Bind AccessibleName, Mode=OneWay}">
|
||||
AutomationProperties.FullDescription="{x:Bind ToolTip, Mode=OneTime}"
|
||||
AutomationProperties.HelpText="{x:Bind Name, Mode=OneTime}"
|
||||
AutomationProperties.Name="{x:Bind AccessibleName, Mode=OneTime}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="48" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ToolTipService.ToolTip>
|
||||
<TextBlock Text="{x:Bind ToolTip, Mode=OneWay}" />
|
||||
<TextBlock Text="{x:Bind ToolTip, Mode=OneTime}" />
|
||||
</ToolTipService.ToolTip>
|
||||
<FontIcon
|
||||
Margin="0,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
FontSize="16"
|
||||
Glyph="{x:Bind IconGlyph, Mode=OneWay}" />
|
||||
Glyph="{x:Bind IconGlyph, Mode=OneTime}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
x:Phase="1"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind Name, Mode=OneWay}" />
|
||||
Text="{x:Bind Name, Mode=OneTime}" />
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Margin="0,0,8,0"
|
||||
@@ -61,7 +61,7 @@
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind ShortcutText, Mode=OneWay}" />
|
||||
Text="{x:Bind ShortcutText, Mode=OneTime}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</controls:PasteFormatTemplateSelector.ItemTemplate>
|
||||
@@ -83,13 +83,13 @@
|
||||
Margin="0,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="16"
|
||||
Glyph="{x:Bind IconGlyph, Mode=OneWay}" />
|
||||
Glyph="{x:Bind IconGlyph, Mode=OneTime}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
x:Phase="1"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{x:Bind Name, Mode=OneWay}" />
|
||||
Text="{x:Bind Name, Mode=OneTime}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</controls:PasteFormatTemplateSelector.ItemTemplateDisabled>
|
||||
@@ -198,7 +198,7 @@
|
||||
<ItemsView.ItemTemplate>
|
||||
<DataTemplate x:DataType="local:ClipboardItem">
|
||||
<ItemContainer
|
||||
AutomationProperties.Name="{x:Bind Description, Mode=OneWay}"
|
||||
AutomationProperties.Name="{x:Bind Description, Mode=OneTime}"
|
||||
CornerRadius="16"
|
||||
ToolTipService.ToolTip="{x:Bind Content}">
|
||||
<Grid
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '..\..\..\..\tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h AdvancedPaste.base.rc AdvancedPaste.rc" />
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted ..\..\..\..\tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h AdvancedPaste.base.rc AdvancedPaste.rc" />
|
||||
</Target>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h EnvironmentVariablesModuleInterface.base.rc EnvironmentVariablesModuleInterface.rc" />
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h EnvironmentVariablesModuleInterface.base.rc EnvironmentVariablesModuleInterface.rc" />
|
||||
</Target>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h FileLocksmithContextMenu.base.rc FileLocksmithContextMenu.rc" />
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h FileLocksmithContextMenu.base.rc FileLocksmithContextMenu.rc" />
|
||||
</Target>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('$(RepoRoot)packages\Microsoft.Windows.CppWinRT.2.0.250303.1\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted '$(RepoRoot)tools\build\convert-resx-to-rc.ps1' '$(MSBuildThisFileDirectory)' resource.base.h resource.h FileLocksmithExt.base.rc FileLocksmithExt.rc" />
|
||||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(RepoRoot)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h FileLocksmithExt.base.rc FileLocksmithExt.rc" />
|
||||
</Target>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user