Zend certified PHP/Magento developer

Issues with import-csv when launching .ps1 file with a .cmd file

I’m trying to write a PowerShell script that will read a CSV file with a list of groups and relevant information for those groups then write them to a registry file (long story). I originally hard coded this information in to the PowerShell script but that made editing and adding groups difficult so I opted for a csv file. The script works fine when in the PowerShell ISE but when I try to launch it with the .cmd file I made to ensure the permissions are correct the PowerShell script is no longer able to pull the information from the csv file. I checked and it only pulls the “undefined” default value

$script:org1 = 'undefined'
$script:org2 = 'undefined'
$script:org3 = 'undefined'
$script:prefix = 'undefined'
$script:baselinetag = 'Standard'

$script:path1 = "HKLM:SoftwareWOW6432NodeBigFixEnterpriseClientSettingsClientOrganization 1"
$script:path2 = "HKLM:SoftwareWOW6432NodeBigFixEnterpriseClientSettingsClientOrganization 2"
$script:path3 = "HKLM:SoftwareWOW6432NodeBigFixEnterpriseClientSettingsClientOrganization 3"


#finds current path and then parent directory to access depts csv file
$scriptPath = (Get-Location)
$ParentPath = Split-Path -Path $scriptPath
$CSVPath = $parentPath + "Depts.csv"

#displays ID # and dept name
$csv = Import-CSV -path $CSVPath
$nameNumber = $csv|Select-Object "ID #","Dept Name"
#Write-Host ($nameNumber -join "`n")
$count = 0
$max = $csv.length +1
while($count -ne $max){ 
read-Host $csv[$count].'ID #'    $csv[$count].'Dept Name'
$count++
}
$ID = Read-Host -Prompt 'Select ID # for the department from the above list '


$script:org1 = $csv[$ID].Org1
$script:org2 = $csv[$ID].Org2
$script:org3 = $csv[$ID].Org3
$script:prefix = $csv[$ID].Prefix
$script:baselinetag = $csv[$ID].Baseline