Starting a powershell script, where I have to connect to the HP server's ilo as part of the overall setup validation. Our ilo naming standard is to replace first character of the server name with a "R", and I am having issues creating a $iloname from the $servername variable.
All server names / ilo IPs are being imported via a csv import. Here is the code:
$SeverName = @()
$iloip = @()
# Import Servername & IP from CSV file
Import-Csv .\ilo.csv
ForEach-Object {
$SeverName += $_.Server_Name
$iloip += $_.ilo_ip
$iloname = ($Servername.Insert(0,"r").Remove(1,1))
Write-Host $iloname
}
and the csv looks like this:
WPXXYYY0app01,192.168.1.1 WPXXYYY0XXapp01,192.168.1.2 WPXXYYY0Zapp01,192.168.1.3 WPXXYYY0pp01,192.168.1.4
Any help to make what I would think simple but I am totatly missing would be greatly apericated!


