Basically, I need to be able to enter .'Nameofmyscript.ps1' 80, 80, 80, 90, 100, 100 (for example) in powershell. With these numbers, the script will do something with them. I just need to be able to type them in how I said above.
I am unable to do this without using a parameter, so I was wondering if there's a way to add a parameter in this. Since in my current script, it only accepts the integers I enter in the actual code.
*Also sorry if my powershell language is a bit messed up, I'm pretty new still. Thanks in advance for any help!
What I have so far:
try
{
[ValidatePattern("^\d+$")]
[int] $G1 = 88
[int] $G2 = 77
[int] $G3 = 66
[int] $G4 = 55
[int] $G5 = 44
[int] $G6 = 33
} catch [System.Management.Automation.ValidationMetadataException] {
[int]$G1 = 10
} catch {
Write-Host "Please make sure you are only inputting integers."
Exit
}
Write-Host $G1
Write-Host $G2
Write-Host $G3
Write-Host $G4
Write-Host $G5
Write-Host $G6