I am would like to read in the text after the last backslash from my text file. Currently I have:
$data=Get-Content \"C:\\temp\\users.txt\"
$HomeDirArray = Get-Content "C:\temp\users.txt" | Split-Path -Leaf will give you an array that can be iterated through using ForEach (e.g., ForEach ($User in $HomeDirArray) {...}.
$HomeDirArray = Get-Content "C:\temp\users.txt" | Split-Path -Leaf
ForEach
ForEach ($User in $HomeDirArray) {...}