working within arrays

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 15 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
hopewu
Posts: 2
Last visit: Mon Mar 17, 2008 1:05 pm

working within arrays

Post by hopewu »

Urgent!!someone can help to do the powershell script: Create an array of 10 scores in a random order (0 to 100). Then,
write the code for calcuating and displaying the highest score. The scirpt should work for any set of scores inseted in the array.Could you email to the address: hopewu12345@yahoo.com.auThanks in advancehope
User avatar
hopewu
Posts: 2
Last visit: Mon Mar 17, 2008 1:05 pm

working within arrays

Post by hopewu »

Urgent!!someone can help to do the powershell script: Create an array of 10 scores in a random order (0 to 100). Then,
write the code for calcuating and displaying the highest score. The scirpt should work for any set of scores inseted in the array.Could you email to the address: hopewu12345@yahoo.com.auThanks in advancehope
User avatar
migreene
Posts: 11
Last visit: Sun Aug 09, 2009 11:26 pm

working within arrays

Post by migreene »

Hey guys, I have a feeling this is a softball lob for someone like Don but definetly not a no-brainer for me as I don't get a lot of PS practice. I need to take an array of computer names and reduce them to the last four numeric digits of each. I can represent this array as a $name or I can include this as a | select statement. What is the best way to proceed? Thanks!
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

working within arrays

Post by jvierra »

$name = "abc1234","bd3456","dsxcev6789"
$name|%{$_.SubString($_.length-4,4)}
This topic is 15 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked