Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Array in Powershell -help pls

Status
Not open for further replies.

Hun9865

Technical User
Oct 23, 2012
23
GB

I used to do array in VBSCRIPT like below… I am not sure how I should do it in PowerShell… Can any help me out…?
dim arrErrors(12)

Code:
arrErrors(0) = "APP0"
arrErrors(1) = " APP1"
arrErrors(2) = " APP2"
arrErrors(3) = " APP3”
arrErrors(4) = "APP4"
arrErrors(5) = "APP5"
arrErrors(6) = "APP6"
arrErrors(7) = "APP7"
arrErrors(8) = "APP8"
arrErrors(9) = "APP9"
arrErrors(10) = "APP10"
arrErrors(11) = "APP11"
arrErrors(12) = "APP12"
for i = 0 to ubound(arrErrors)
	strError = arrErrors(i)
	if (left(lcase(strErrorLine), len(strError)) = lcase(strError)) then
	objErrorLog.WriteLine strErrorLine & vbTab & strComputer & vbTab & "Found Error number" & vbTab & i
	exit for
	end If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top