Author Posts

May 25, 2017 at 12:02 am

Hello all. This is my first time on this site and my first crack at power shell. I am trying to build a script where i can right click anywhere and from the drop-down context menu i can pick my powershell script and it will execute it. I have that registry tweak figure out as i built this same thing as a batch file already. Now i would like to build it in powershell. What i am trying to do is build some folders from user input in the current directory and copy a file and that is where i get stumped. I know the following is very elementary but we all have to start somewhere. Can anyone provide and assistance please? thx.

$curd= get-location
$pnum=read-host "enter number"
$psuf=read-host "enter suffix"
$pnam=read-host "enter name"
new-item -path $curd -name $pnam -type dir
copy-item "C:\Project\test.dotx" "$curd\$pnam\$pnum-$psuf.dotx"

May 25, 2017 at 8:59 am

$curd= get-location
$pnum=read-host "enter number"
$psuf=read-host "enter suffix"
$pnam=read-host "enter name"
new-item -path $curd -name $pnam -type dir
copy-item d:\try\test.txt -Destination $curd\$pnam\$pnum-$psuf.dotx

May 26, 2017 at 3:47 pm

worked great... thanks Chris