Edit: I have now replaced the user with "$env:username" to correct the first part. Would anyone know how to know add a prompt before running the code to allow a user to type nothing, "A", "B", "C" to replace (version) in the code on the first line?
I completed a code in Powershell to copy files from one destination to the other. I am hoping to make it so when running script, the user can enter their alias and it will replace "alias" in the script. The second thing would be for the user to enter "A" "B" "C" or nothing in order to replace "(version)" in the script.
#Create New Folders
new-item -path "C:\Users\$env:username\Archive" -name "TeamsCopy$((get-date).tostring("MMdd"))(version)" -itemtype "directory"
new-item -path "C:\Users\$env:username\Archive\TeamsCopy$((get-date).tostring("MMdd"))\Canada" -itemtype "directory"
#Copy Files
Copy-item -path "C:\Users\$env:username\SourceFolder\Canada.xlsx" -destination "C:\Users\alias\Archive\TeamsCopy$((get-date).tostring("MMdd"))\Canada"
Does anyone have any idea how to add this in as a prompt and then also the right syntax to use?