1
    @echo off


::
:: Grabbing the users input of job number to create
:: 
SET /P JobNum="Enter Job Number: "


::
:: Creating the job number folder structure
::
MKDIR "\\server\jobs\%JobNum%"
MKDIR "\\server\jobs\%JobNum%\DataPrep"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Data"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Data\Input"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Data\Working"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Programs"
MKDIR "\\server\jobs\%JobNum%\DataPrep\Docs"
MKDIR "\\server\jobs\%JobNum%\Prepress"
MKDIR "\\server\jobs\%JobNum%\Prepress\Working"
MKDIR "\\server\jobs\%JobNum%\Prepress\PNetImages"
MKDIR "\\server\jobs\%JobNum%\CSR"
MKDIR "\\server\jobs\%JobNum%\Production"
MKDIR "\\server\jobs\%JobNum%\Production\MailDocs"
MKDIR "\\server\jobs\%JobNum%\Production\Output"

需要将其转换为 PS 脚本。不确定 PS 命令以及它们如何从批处理文件中转换。

4

1 回答 1

1

尝试这样的事情:

$JobNum = Read-Host -Prompt "Enter Job Number: "
("",
"\DataPrep",
"\DataPrep\Data",
"\DataPrep\Data\Input",
"\DataPrep\Data\Working",
"\ DataPrep\Programs"、
"\DataPrep\Docs"、
"\Prepress"、
"\Prepress\Working"、
"\Prepress\PNetImages"、
"\CSR"、
"\Production"、
"\Production\MailDocs"、
"\生产\输出") |
foreach-object { new-item -type directory -path "\server\jobs\$JobNum$_" }

于 2012-09-30T04:04:22.647 回答