You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- New file: Demo - Message boxes in PowerShell.ps1
- New file: Functions library.psm1
- Fix typo in the name of Download-Channel9VideosFromRSS.ps1
- Rename: README.md to README.markdown
- Update README.markdown
Unregisters several scheduled tasks whose names matches a wildcard patten (not regex)
24
+
.DESCRIPTION
25
+
Uses Get-ScheduledTask to get a list of all scheduled tasks, filters then via the -like operator, and runs Unregister-ScheduledTask against the resulting set.
Write-Verbose"Found no scheduled tasks matching the requested criteria"
51
+
}
52
+
}
53
+
54
+
functionRemove-RegistryValues {
55
+
<#
56
+
.SYNOPSIS
57
+
Attempts to remove one or more values from a given path in Windows Registry.
58
+
.DESCRIPTION
59
+
Removes one or more specified values from a given path in Windows Registry, if they exist. Remains silent if they don't exist. Generates a warning in the even of other problems.
Opens the "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" path of Windows Registry, looks for two values: "AppThatIJustUninstalled-TrayIcon", "AppThatIJustUninstalled-Updater". If they exist, deletes them.
Copy file name to clipboardExpand all lines: README.markdown
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ Scripts for carrying out administrative tasks, mostly in Windows
7
7
Deals with Microsoft Store app packages.
8
8
9
9
1.`Inventory AppX Packages.ps1`: The `Get-AppxPackage` cmdlet in PowerShell can find all installed Microsoft Store apps, but it does not do a good job of discovering their display names. At best, it can show the technical package name. This script lists all AppX packages installed for the current user account, along with their display names. It accepts a `-Verbose` switch and its output can be piped to `Format-Table` or `Format-List`. I believe it can be expanded to work machine-wide.
10
-
2.`Reinstall-AppxPackages.ps1`: This script belongs to long-gone days. Nowdays, it is probably just dangerous. It is used to reset and re-register all AppX packages that were either shipped with Windows or were published by Microsoft. It is a safer alternative to the utterly sadistic oneliner that retrived a list of all AppX packages and reset them all.
11
-
3.`Repair system apps.ps1`: This script also belongs to long-gone days. Nowdays, it is probably just dangerous. It re-registers all AppX packages installed in the "SystemApp" folder.
12
-
4.`(Specialized) Remove these appx packages.ps1`: This one is mostly for me, but others can find educational value in it. This script uninstalls a number of Microsoft Store apps for all users, without deleting their provisioned packages. I believe it can only run on Windows 10 version 1809 or later.
10
+
2.`Reinstall-AppxPackages.ps1`: This script belongs to long-gone days. Nowadays, it is probably just dangerous. It resets and re-registers all AppX packages that were either shipped with Windows or were published by Microsoft. It is a safer alternative to the utterly sadistic one-liner that retrieves a list of all AppX packages and reset them all.
11
+
3.`Repair system apps.ps1`: This script also belongs to long-gone days. Nowadays, it is probably just dangerous. It re-registers all AppX packages installed in the "SystemApp" folder.
12
+
4.`(Specialized) Remove these AppX packages.ps1`: This one is mostly for me, but others can find educational value in it. This script uninstalls a number of Microsoft Store apps for all users, without deleting their provisioned packages. I believe it can only run on Windows 10 version 1809 or later.
13
13
14
14
## BITS
15
15
@@ -21,7 +21,7 @@ Deals with Microsoft Store app packages.
21
21
22
22
## Download
23
23
24
-
1.`Download-Channl9VideosFromRSS.ps1` helps download entire Channel 9 sets of videos. It accepts one RSS URL for the video set and one download location.
24
+
1.`Download-Channel9VideosFromRSS.ps1` helps download entire Channel 9 sets of videos. It accepts one RSS URL for the video set and one download location.
25
25
26
26
## Firewall
27
27
@@ -31,19 +31,19 @@ Deals with Microsoft Store app packages.
31
31
32
32
There was a period of time when Windows was plagued with bugs that corrupted the icon cache. These scripts were conceived in that time, as ways of mitigating the problem. I have long stopped using them though.
33
33
34
-
`Refresh icon cache with MoveFile.cmd` is the most effective of those but it is hard-coded to use an installed copy of `movefile.exe` from the Microsoft Sysinternals utility set.
34
+
`Refresh icon cache with MoveFile.cmd` is the most effective of those but it is hard-coded to use an installed copy of `MoveFile.exe` from the Microsoft Sysinternals utility set.
35
35
36
36
## Last logon time
37
37
38
-
`lastlogon.vbs` takes a long time to run, but returns a list of all local users and the date and time of their last logon action.
38
+
`LastLogon.vbs` takes a long time to run, but returns a list of all local users and the date and time of their last logon action.
39
39
40
40
A matter of licensing: I did not write this script. The user who posted it was called `Corvus1` and posted it in educational spirit.
41
41
42
42
## Maintenance
43
43
44
44
1.`Repair-AllVolumes.ps1`: Enumerates all fixed-disk volumes and sequentially runs `Repair-Volume` on them to scan them for errors.
45
45
2.`Repair-Windows.ps1`: Repairs the online Windows instance by running DISM and SFC. Their logs are moved to the desktop.
46
-
3.`NGEN Update.bat`: Runs NGEN inside Windows PowerShell. While PowerShell 6 and 7 run on .NET Core, Windows PowerShell and some Windows-exclusive PowerShell modules (which PowerShell 7 also loads) run on .NET Framework. Run this script with admin privileges whenever you update .NET Framework, or whenever you feel Windows PowerShell or PowerShell 7 for Windows are sluggish at launch time.
46
+
3.`nGen Update.bat`: Runs nGen inside Windows PowerShell. While PowerShell 6 and 7 run on .NET Core, Windows PowerShell and some Windows-exclusive PowerShell modules (which PowerShell 7 also loads) run on .NET Framework. Run this script with admin privileges whenever you update .NET Framework, or whenever you feel Windows PowerShell or PowerShell 7 for Windows are sluggish at launch time.
47
47
48
48
## Security
49
49
@@ -90,7 +90,7 @@ The names of these scripts are self-explanatory.
90
90
91
91
## Time
92
92
93
-
1.`Firmware time is UTC.reg`: Configures Windows to interpret the real-time clock as UTC time. Ordinarily, Windows interprets it as the local time correponding to the time zone you've selected. Most Linux distros that interpret it as UTC, so you may need this script if you multi-boot a Linux distro along Windows. After applying this, restart the computer.
93
+
1.`Firmware time is UTC.reg`: Configures Windows to interpret the real-time clock as UTC time. Ordinarily, Windows interprets it as the local time corresponding to the time zone you've selected. Most Linux distros that interpret it as UTC, so you may need this script if you multi-boot a Linux distro along Windows. After applying this, restart the computer.
94
94
95
95
## Unicode test suite
96
96
@@ -112,3 +112,10 @@ The following two scripts are co-developed with Ramesh Srinivasan (the author of
112
112
113
113
1. Find current wallpaper (Windows 7).ps1
114
114
2. Find current wallpaper (Windows 8,10).ps1
115
+
116
+
## (Code snippets)
117
+
118
+
This special folder contains source code that one should not run directly. Rather, PowerShell developers could read them, learn from them, or include portions of them in their PowerShell scripts.
119
+
120
+
1.`Function library.psm1`: Contains a number of reusable functions. I've chosen the `.psm1` filename extension to prevent it from being accidentally run as a script. Each function has its own local help.
121
+
2.`Demo - Message boxes in PowerShell.ps1`: This scripts demonstrates how to invoke message boxes within a PowerShell script. Normally, one must not use message boxes (or `Write-Host`) inside PowerShell scripts. Before Windows 10, however, console apps had serious problems displaying Unicode characters, so I used message boxes instead.
0 commit comments