mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 21:07:40 +02:00
Added the #requires statement
This commit is contained in:
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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 "~"
|
||||
|
@ -14,6 +14,8 @@
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
#requires -version 5.1
|
||||
|
||||
param([string]$folderName = "")
|
||||
|
||||
try {
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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" }
|
||||
|
||||
|
Reference in New Issue
Block a user