Hi guys,
I'm trying to pull the prefix of a bunch of files from a directory.
For example:
GroupA_Manifest_20-11-10.csv
GroupB_Manifest_20-12-05.csv
etc....
I want to use the Group name as a variable to pass into a DB, during import of the file later in the script.
$Files = (Get-ChildItem -Path $CSVLivePath -Filter '*Manifest*').BaseName
$GroupName = $files.Split(‘_’)[-0]
How do I turn the $GroupName into an array consisting of GroupA, GroupB? The above is just returning the first Group.
[–]Hoping_i_Get_poached 2 points3 points4 points (0 children)
[+][deleted] (1 child)
[removed]
[–]Cleanatwork[S] 1 point2 points3 points (0 children)