New-NanoServerImage cmdlet does not use -logpath location
i trying create 100s of nanoserver images using new-nanoserverimage cmdlet. parallelize operation running new-nanoserver image cmdlet job within start-job block.
new-nanoserverimage -edition datacenter -deploymenttype guest -mediapath d:\ -basepath $basepathnew -targetpath $targetpath -computername $vmname -administratorpassword $pass -logpath $logpath -storage -verbose
the $logpath variable changes each iteration of while loop. but, find on execution of jobs start writing logs @ default location , throwing error there n number of jobs running same command simultaneously.
process cannot access file 'c:\users\administrator.domain\appdata\local\temp\nanoserverimagegenerator.log'because being used process.
+ categoryinfo : openerror: (:) [out-file], ioexception
+ fullyqualifiederrorid : fileopenfailure,microsoft.powershell.commands.outfilecommand
+ pscomputername : localhost
i following below article. in solving helpful.
https://technet.microsoft.com/en-us/windows-server-docs/get-started/nano-server-quick-start
hi,
>>throwing error there n number of jobs running same command simultaneously.
we couldn't this: error has pointed out issue.
>>create 100s of nanoserver images using new-nanoserverimage cmdlet. parallelize operation
did mean use workflow?
you try use foreach loop structure or if structure job.
besides, suppose job not complex: have 2 ways this:
1> open powershell console, type show-command, in new opened console, type new-nanoserverimage , fill in parameters;
2>using tools->nano server image builder:
https://www.microsoft.com/en-us/download/details.aspx?id=54065
sometimes change mind give clue.
best regards,
andy
please remember mark replies answers if help.
if have feedback technet subscriber support, contact tnmff@microsoft.com.
Windows Server > Windows Server 2016 General
Comments
Post a Comment