mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-13 14:37:19 +02:00
Added the #requires statement
This commit is contained in:
@ -12,6 +12,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -version 5.1
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($IsLinux -or $IsMacOS) {
|
if ($IsLinux -or $IsMacOS) {
|
||||||
if (-not(Test-Path "~/Documents" -pathType container)) {
|
if (-not(Test-Path "~/Documents" -pathType container)) {
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -version 5.1
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($IsLinux -or $IsMacOS) {
|
if ($IsLinux -or $IsMacOS) {
|
||||||
if (-not(Test-Path "~/Downloads" -pathType container)) {
|
if (-not(Test-Path "~/Downloads" -pathType container)) {
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -version 5.1
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$path = [Environment]::GetFolderPath('Fonts')
|
$path = [Environment]::GetFolderPath('Fonts')
|
||||||
if (-not(Test-Path "$path" -pathType container)) {
|
if (-not(Test-Path "$path" -pathType container)) {
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -version 5.1
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (-not(Test-Path "~" -pathType container)) { throw "No home directory at: $path" }
|
if (-not(Test-Path "~" -pathType container)) { throw "No home directory at: $path" }
|
||||||
$path = Resolve-Path "~"
|
$path = Resolve-Path "~"
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -version 5.1
|
||||||
|
|
||||||
param([string]$folderName = "")
|
param([string]$folderName = "")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -version 5.1
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (Test-Path "~/Repos" -pathType container) { $path = "~/Repos"
|
if (Test-Path "~/Repos" -pathType container) { $path = "~/Repos"
|
||||||
} elseif (Test-Path "~/repos" -pathType container) { $path = "~/repos"
|
} elseif (Test-Path "~/repos" -pathType container) { $path = "~/repos"
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -version 5.1
|
||||||
|
|
||||||
function GetCurrentUserSID { [CmdletBinding()] param()
|
function GetCurrentUserSID { [CmdletBinding()] param()
|
||||||
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
|
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
|
||||||
return ([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).SID.Value
|
return ([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).SID.Value
|
||||||
|
@ -12,6 +12,8 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
|
#requires -version 5.1
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($IsLinux -or $IsMacOS) { throw "This script requires a Windows operating system" }
|
if ($IsLinux -or $IsMacOS) { throw "This script requires a Windows operating system" }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user