Using PowerShell ISE or VSCode, create a PowerShell script that will do the following:
$Path = "Enter Path Here!!"
Join-Path -Path $path -ChildPath "test.csv"
$counter = 1
$Header = "Name", "Address" , "City", "State", "Zip", "Phone
Number"
$Header | foreach {Add-Content -Path $Path -Value $_}
while ($counter -ne 0){
$Name = Read-Host -Prompt 'Input Name: '
$Address = Read-Host -Prompt 'Input Address: '
$City = Read-Host -Prompt 'Input City: '
$State = Read-Host -Prompt 'Input State: '
$Zip = Read-Host -Prompt 'Input Zip Code: '
$Phone = Read-Host -Prompt 'Input Phone Number: '
$continue = Read-Host -Prompt "Do you want to continue?
[Y/N]"
if ($continue -eq 'n' -or $continue -eq 'N'){
$counter = 0
}
$data = $name, $Address, $City, $State, $Zip, $Phone
$data | foreach {Add-Content -Path $path -Value $_ }
}
Get Answers For Free
Most questions answered within 1 hours.