From a8f100e85b92b9af1bf84d944013fbc92060d64f Mon Sep 17 00:00:00 2001 From: reiyua Date: Fri, 12 Apr 2024 21:00:54 +1000 Subject: [PATCH] Add file path checking component --- AutoOUADCreator.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AutoOUADCreator.ps1 b/AutoOUADCreator.ps1 index 1894b10..dfbeaa6 100644 --- a/AutoOUADCreator.ps1 +++ b/AutoOUADCreator.ps1 @@ -10,6 +10,11 @@ import-module ActiveDirectory #Get user to specify path of the CSV file containing OU names to be added into the Active Directory. $fpath = Read-Host -Prompt "Please enter the path to your CSV file containing OU info to be added within the Active Directory Domain Forest" +# Check if the CSV file exists +if (Test-Path $fpath) { + # Display path to file given by end-user + echo $fpath + # Display path to file given by end-user echo $fpath