I try to create a loop Like Excel
$csv = Import-Excel “C:\Script\tes.xlsx”
$Count=0
foreach ($item in $csv){
” $($item.example) $($item.example) “
$datagridview1.Rows | Select-Object -ExpandProperty DataBoundItem | Export-Csv $home\AppData\Local\Temp\test.csv -NoTypeInformation -Encoding UTF8 -Force
$csv = Import-Csv -Path $home\AppData\Local\Temp\Test.csv
$Count = 0
foreach ($item in $csv)
{
Start-Process -FilePath SSh.exe -ArgumentList "$($item.ipaddress)"
$Divacename = Echo 'test "$($item.Divacename)"
$provisioning = Echo 'test' "$($item.provisioning)"
Or
foreach ($item in $datagridview1)
{
Start-Process -FilePath SSh.exe -ArgumentList "$($item.ipaddress)"
$Divacename = Echo 'Test' "$($item.Divacename)"
$provisioning = Echo 'Test2' "$($item.provisioning)"
How to foreach from datagridview
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.
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.