Help with passing variables form getinput

Dec 7, 2016 at 4:24 AM
Import-Module ShowUi
$Location = "H:\03 Sales\02 Proposals"

Get-Input @{

"User" = "Proposal Number"


"title" = "title of project"

}-Order "User", "title" -show

Get-PowerShellOutput

New-Item -Path $Location -Name "Q00$value.User $value.title " -ItemType "directory"
$Location1 = "H:\03 Sales\02 Proposals\Q00$value.User $value.title "
New-Item -Path $Location1 -Name "01 Client Info" -ItemType "directory"
New-Item -Path $Location1 -Name "02 Correspondence" -ItemType "directory"
New-Item -Path $Location1 -Name "03 Proposal" -ItemType "directory"
$Location2 = "C:\Users\Mcu_117\Desktop\reow\Q00$value.User $value.title\03 Proposal "
New-Item -Path $Location2 -Name "01 Information" -ItemType "directory"
Copy-Item -Path "H:\03 Sales\02 Proposals\templates\A.xlsx" -Destination "H:\03 Sales\02 Proposals\Q00$value.User $value.title\03 Proposal "
Copy-Item -Path "H:\03 Sales\02 Proposals\templates\B.docx" -Destination "H:\03 Sales\02 Proposals\Q00$value.User $value.title\03 Proposal "
Rename-Item -NewName "Q00$value.User $value.title CTR Rev A.xlsx " -Path "H:\03 Sales\02 Proposals\Q00$value.User $value.title\03 Proposal\A.xlsx"
Rename-Item -NewName "Q00$value.User $value.title Proposal Rev A.docx " -Path "H:\03 Sales\02 Proposals\Q00$value.User $value.title\03 Proposal\B.docx"


Above is code Im trying to get the user to input the proposal number and the title of the project and then automatically generate the directories with the files aswell.
Coordinator
Mar 15 at 10:39 PM
Edited Mar 15 at 10:40 PM
I'm not clear what the problem is.
$Value = Get-Input @{
    "User" = "Proposal Number"
    "Title" = "title of project"
} -Order "User", "title" -show 


New-Item -Path $Location -Name ("Q00" + $value.User + $value.title) -ItemType "directory"
You need to capture the output of Get-Input into your variable, and then you need to properly concatenate all those strings -- you can't put $value.title in a string, you need to append it with + or use the $( ... ) subexpression syntax like:
$Location2 = "C:\Users\Mcu_117\Desktop\reow\Q00$($value.User) $($value.title)\03 Proposal"