Powershell dynamic path when create folder -


i want create folder, don't know how use variable define path.

as is:

new-item -itemtype directory -path "c:\users\tizio.caio\desktop\backup_$((get-date).tostring('yyyymmdd'))" 

i want replace c:\users\tizio.caio\desktop\ variable in order make future reworks easier.

i split directory , filename, , use environment variable userprofile

$var    = $env:userprofile + "\desktop\" $backup = "backup_$((get-date).tostring('yyyymmdd'))"  new-item -itemtype directory -path "$var$backup" 

Comments

Popular posts from this blog

go - serving up pdfs using golang -

python - Best design pattern for collection of objects -

r - Using `bbmle:mle2` with vector parameters (already works using `optim`) -