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

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -