Skip to content

Commit 42eafa6

Browse files
committed
Move #Requires -Version to the top
1 parent 8f2e30f commit 42eafa6

17 files changed

+38
-32
lines changed

Graphics/Find good JPEG images (Opt-1).ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Requires -Version 7.2
2+
13
<#
24
.SYNOPSIS
35
Finds valid JPEG images in folder through parsing their first 32 kb.
@@ -17,8 +19,6 @@
1719
understand. (GDI+ raises error code 0x80004005.) GDI+ does not understand arithmetic coding.
1820
#>
1921

20-
#Requires -Version 7.2
21-
2222
using namespace System.Management.Automation
2323
using namespace System.Drawing
2424

Graphics/Find good JPEG images.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Requires -Version 7.2
2+
13
<#
24
.SYNOPSIS
35
Finds valid JPEG images in folder.
@@ -17,8 +19,6 @@
1719
understand. (GDI+ raises error code 0x80004005.) GDI+ does not understand arithmetic coding.
1820
#>
1921

20-
#Requires -Version 7.2
21-
2222
using namespace System.Management.Automation
2323
using namespace System.Drawing
2424

Hardware/Get-CpuIntrinsicsSupport.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#Requires -Version 7.4
2+
# This script mustn't run on anything less than .NET 8.0.
3+
14
<#
25
.SYNOPSIS
36
Queries all supported CPU instruction-set extensions for x86 and x86-64 systems and reports their
@@ -14,9 +17,6 @@
1417
This script requires PowerShell 7.4 because it uses .NET 8.0.
1518
#>
1619

17-
#Requires -Version 7.4
18-
# This script mustn't run on anything less than .NET 8.0.
19-
2020
using namespace System.Management.Automation
2121
using namespace System.Runtime.Intrinsics.X86
2222

Hardware/Set-BluetoothRadio.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Requires -Version 5.1
2+
13
[CmdletBinding()]
24
Param (
35
[Parameter(Mandatory = $true)]

Maintenance/Find redundant drivers.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
<#
1+
#Requires -Version 5.1
2+
#Requires -RunAsAdministrator
3+
4+
<#
25
36
COPYRIGHT NOTCE
47
This script has been derived from:
@@ -36,9 +39,6 @@ Contents of the Drivers.ps1 license is as follows:
3639
3740
#>
3841

39-
#Requires -Version 5.1
40-
#Requires -RunAsAdministrator
41-
4242
using namespace System.Management.Automation
4343

4444
[CmdletBinding()]

Maintenance/Optimize PATH variable.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Requires -Version 5.1
2+
13
<#
24
.SYNOPSIS
35
Optimizes the PATH environment variable.
@@ -15,8 +17,6 @@
1517
Reads the PATH environment variable and returns an optimized version.
1618
#>
1719

18-
#Requires -Version 5.1
19-
2020
using namespace System.Management.Automation
2121
using namespace System.Collections.Generic
2222

Maintenance/Repair all volumes.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#Requires -Version 5.1
12
#Requires -RunAsAdministrator
23

34
function Get-EligibleVolume {

Security/Others/Clear Windows Defender history.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#Requires -Version 5.1
12
#Requires -RunAsAdministrator
23

34
Remove-Item 'C:\ProgramData\Microsoft\Windows Defender\Scans\History\Service' -Recurse -Force

Shell/Wallpaper/Find current wallpaper (Windows 7).ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<#
1+
#Requires -Version 5.1
2+
3+
<#
24
.SYNOPSIS
35
Finds the Windows wallpaper on Windows 7 and Windows Server 2008 R2.
46
.DESCRIPTION
@@ -16,8 +18,6 @@
1618
This script doesn't support multiple monitors.
1719
#>
1820

19-
#Requires -Version 5.1
20-
2121
using namespace System.Management.Automation
2222
using namespace System.Windows.Forms
2323

Shell/Wallpaper/Find current wallpaper.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Requires -Version 5.1
2+
13
<#
24
.SYNOPSIS
35
Finds Windows wallpapers
@@ -15,8 +17,6 @@
1517
Hence, it is not automation-friendly.
1618
#>
1719

18-
#Requires -Version 5.1
19-
2020
using namespace System.Management.Automation
2121
using namespace System.Windows.Forms
2222
using namespace System.Collections.Generic

Update management/Clear Windows Update history.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#Requires -Version 5.1
12
#Requires -RunAsAdministrator
23
using namespace System.Management.Automation
34

Update management/Find update on Microsoft Catalog.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#Requires -Version 5.1
2+
13
<#
24
.SYNOPSIS
35
Finds an update package on Microsoft Catalog and returns its ID.
@@ -27,8 +29,6 @@
2729
Special thanks to Wolfgang Sommergut for his educational article.
2830
#>
2931

30-
#Requires -Version 5.1
31-
3232
using namespace System.Management.Automation
3333

3434
[CmdletBinding()]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#Requires -Version 5.1
12
(New-Object -ComObject Microsoft.Update.ServiceManager).Services | Format-Table -Property Name,IsDefaultAUService

Update management/Install updates with Dism.exe.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<#
1+
#Requires -Version 5.1
2+
3+
<#
24
.SYNOPSIS
35
Short description
46
.DESCRIPTION
@@ -14,8 +16,6 @@
1416
General notes
1517
#>
1618

17-
#Requires -Version 5.1
18-
1919
using namespace System.Management.Automation
2020
using namespace System.Windows.Forms
2121
using namespace System.Security.Principal

Update management/Install updates with MsiExec.exe.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<#
1+
#Requires -Version 5.1
2+
3+
<#
24
.SYNOPSIS
35
Short description
46
.DESCRIPTION
@@ -14,8 +16,6 @@
1416
General notes
1517
#>
1618

17-
#Requires -Version 5.1
18-
1919
using namespace System.Management.Automation
2020
using namespace System.Windows.Forms
2121
using namespace System.Security.Principal

Update management/Install updates with PowerShell.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<#
1+
#Requires -Version 5.1
2+
3+
<#
24
.SYNOPSIS
35
Short description
46
.DESCRIPTION
@@ -14,8 +16,6 @@
1416
General notes
1517
#>
1618

17-
#Requires -Version 5.1
18-
1919
using namespace System.Management.Automation
2020
using namespace System.Windows.Forms
2121
using namespace System.Security.Principal

Update management/Install updates with Wusa.exe.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<#
1+
#Requires -Version 5.1
2+
3+
<#
24
.SYNOPSIS
35
Short description
46
.DESCRIPTION
@@ -14,8 +16,6 @@
1416
General notes
1517
#>
1618

17-
#Requires -Version 5.1
18-
1919
using namespace System.Management.Automation
2020
using namespace System.Windows.Forms
2121
using namespace System.Security.Principal

0 commit comments

Comments
 (0)