File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ <#
2+ . Synopsis
3+ Short description
4+ This script will be used for downloafing the latest TortoiseGit version from its official site.
5+ . DESCRIPTION
6+ Long description
7+ 2021-02-06 Sukri Created.
8+ . EXAMPLE
9+ Example of how to use this cmdlet
10+ . EXAMPLE
11+ Another example of how to use this cmdlet
12+ . INPUTS
13+ Inputs to this cmdlet (if any)
14+ . OUTPUTS
15+ Output from this cmdlet (if any)
16+ . NOTES
17+ General notes
18+ Author : Sukri Kadir
19+ 20+ . COMPONENT
21+ The component this cmdlet belongs to
22+ . ROLE
23+ The role this cmdlet belongs to
24+ . FUNCTIONALITY
25+ The functionality that best describes this cmdlet
26+ #>
27+
28+ function Get-AdminRights {
29+ Param
30+ (
31+ [ValidateNotNullOrEmpty ()]
32+ [String ]
33+ $IsAdministrator = $null # initialize the variable to null.
34+ )
35+
36+ Begin {
37+ # get boolean value if script ran with administration right.
38+ $IsAdministrator = ([Security.Principal.WindowsPrincipal ][Security.Principal.WindowsIdentity ]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole ]::Administrator)
39+ }
40+ Process {
41+ # verbose the message.
42+ if ($IsAdministrator -eq $true ) {
43+ Write-Warning - Message " It is currently in administration right." - WarningAction Continue
44+ }
45+
46+ if ($IsAdministrator -ne $true ) {
47+ Write-Warning - Message " It is currently NOT in administration right." - WarningAction Continue
48+ }
49+ }
50+ End {
51+ return $IsAdministrator
52+ }
53+ }
You can’t perform that action at this time.
0 commit comments