diff --git a/scripts/cd-docs.ps1 b/scripts/cd-docs.ps1 index 32cb8572..0178c181 100755 --- a/scripts/cd-docs.ps1 +++ b/scripts/cd-docs.ps1 @@ -12,6 +12,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { if ($IsLinux -or $IsMacOS) { if (-not(Test-Path "~/Documents" -pathType container)) { diff --git a/scripts/cd-downloads.ps1 b/scripts/cd-downloads.ps1 index 7259c6a0..5c8ef6e6 100755 --- a/scripts/cd-downloads.ps1 +++ b/scripts/cd-downloads.ps1 @@ -12,6 +12,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { if ($IsLinux -or $IsMacOS) { if (-not(Test-Path "~/Downloads" -pathType container)) { diff --git a/scripts/cd-fonts.ps1 b/scripts/cd-fonts.ps1 index b06f0e7e..7d5c9d81 100755 --- a/scripts/cd-fonts.ps1 +++ b/scripts/cd-fonts.ps1 @@ -12,6 +12,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { $path = [Environment]::GetFolderPath('Fonts') if (-not(Test-Path "$path" -pathType container)) { diff --git a/scripts/cd-home.ps1 b/scripts/cd-home.ps1 index 0b5d6f22..7b2604ce 100755 --- a/scripts/cd-home.ps1 +++ b/scripts/cd-home.ps1 @@ -12,6 +12,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { if (-not(Test-Path "~" -pathType container)) { throw "No home directory at: $path" } $path = Resolve-Path "~" diff --git a/scripts/cd-repo.ps1 b/scripts/cd-repo.ps1 index 31cf7c54..117093e7 100755 --- a/scripts/cd-repo.ps1 +++ b/scripts/cd-repo.ps1 @@ -14,6 +14,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + param([string]$folderName = "") try { diff --git a/scripts/cd-repos.ps1 b/scripts/cd-repos.ps1 index f82e27ca..c69af1d6 100755 --- a/scripts/cd-repos.ps1 +++ b/scripts/cd-repos.ps1 @@ -12,6 +12,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { if (Test-Path "~/Repos" -pathType container) { $path = "~/Repos" } elseif (Test-Path "~/repos" -pathType container) { $path = "~/repos" diff --git a/scripts/cd-trash.ps1 b/scripts/cd-trash.ps1 index faac9341..eef88a26 100755 --- a/scripts/cd-trash.ps1 +++ b/scripts/cd-trash.ps1 @@ -12,6 +12,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + function GetCurrentUserSID { [CmdletBinding()] param() Add-Type -AssemblyName System.DirectoryServices.AccountManagement return ([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).SID.Value diff --git a/scripts/cd-windows.ps1 b/scripts/cd-windows.ps1 index e93c4c64..810388c0 100755 --- a/scripts/cd-windows.ps1 +++ b/scripts/cd-windows.ps1 @@ -12,6 +12,8 @@ Author: Markus Fleschutz | License: CC0 #> +#requires -version 5.1 + try { if ($IsLinux -or $IsMacOS) { throw "This script requires a Windows operating system" }