Add credit for CSV file verification

This commit is contained in:
Ray 2024-04-12 19:11:29 +10:00 committed by GitHub
parent 50fc91d921
commit b4dff5966f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,8 @@ $fpath = Read-Host -Prompt "Please enter the path to your CSV file:"
# Check if CSV file exists with the path specified by the end-user
# If so, error out the program with generic error stating so. (RAYYAN Contribution)
# This uses the "Test-Path" cmdlet which tests if the path actually exists and can be read by the system.
# Source for code (https://www.itechguides.com/powershell-check-if-file-exists/#:~:text=If%20(Test%2DPath%20%2DPath%20E%3A%5Creports%5Cprocesses.txt%20)%20%7B%0ACopy%2DItem%20%2DPath%20E%3A%5Creports%5Cprocesses.txt%20%2DDestination%20C%3A%5Creports%0A%7D)
if (-not (Test-Path $fpath)) {
Write-Host "CSV file does not exist. Exiting script."
exit