samples/SampleScript3.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#requires -version 5.0
#requires -RunAsAdministrator

#this is a sample script

Param (
    [Parameter(Position = 0, HelpMessage = "How many numbers do you want?")]
    [int]$Count = 1,
    [string]$Name,
    [switch]$Demo
)

Write-Host "this is a sample script that doesn't do anything but write a random number" -ForegroundColor Yellow

#get numbers
1..$count | ForEach-Object {
    Get-Random -Minimum 1 -Maximum 1000
}

Write-Host "Ending script" -ForegroundColor yellow

#eof