locked
Copy-Item error creating Nano server image RRS feed

  • Question

  • I'm following the documentation for creating a Nano server image (https://technet.microsoft.com/en-us/library/mt126167.aspx) and I've run into some issues.  I'm doing this on a Windows 7 machine.

    First, the step to run the command 

    Import-Module NanoServerImageGenerator.psm1 -Verbose

    doesn't seem to work on my machine unless a add a `.\` in front of the psm1 file.

    The second and blocking issue I've run into is the command

    New-NanoServerImage -MediaPath f:\ -BasePath .\Base -TargetPath .\Nano1\Nano.vhd -ComputerName Nano1 –GuestDrivers

    terminates with the following error:

    WARNING: Terminating due to an error. See log file at: C:\Users\semoore\AppData\Local\Temp\NanoServerImageGenerator.log
    Copy-Item : Incorrect function.
    At C:\NanoServer\NanoServerImageGenerator.psm1:1545 char:5
    +     Copy-Item -Path $Script:SourcesPath\* -Destination $Script:BaseToolsPath -Ex ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Copy-Item], IOException
        + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.CopyItemCommand

    Any ideas what might be going on here?  The log file doesn't give any additional data.


    Thursday, April 7, 2016 1:30 PM

Answers

  • Hi Smooretech,

    >>doesn't seem to work on my machine unless a add a `.\` in front of the psm1 file.

    You may post in Powershell forum about the issue of importing module.

    About the failure of the command:

    >>I'm doing this on a Windows 7 machine.

    I'm afraid it could not be done on Windows 7 as far as I know.

    Try on Server 2012, 2012 R2 or Windows 10.

    Best Regards,

    Leo


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Leo Han Thursday, April 14, 2016 8:11 AM
    • Marked as answer by smooretech Thursday, April 14, 2016 12:50 PM
    Friday, April 8, 2016 6:34 AM

All replies

  • Hi Smooretech,

    >>doesn't seem to work on my machine unless a add a `.\` in front of the psm1 file.

    You may post in Powershell forum about the issue of importing module.

    About the failure of the command:

    >>I'm doing this on a Windows 7 machine.

    I'm afraid it could not be done on Windows 7 as far as I know.

    Try on Server 2012, 2012 R2 or Windows 10.

    Best Regards,

    Leo


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Proposed as answer by Leo Han Thursday, April 14, 2016 8:11 AM
    • Marked as answer by smooretech Thursday, April 14, 2016 12:50 PM
    Friday, April 8, 2016 6:34 AM
  • In regards to the Import-Module cmdlet needing the .\ in front of the file name, that is standard PowerShell syntax.  That is simply telling PowerShell to find the file in the current directory.   If you type 'Import-Module Nanoserver<tab>' PowerShell will automatically complete the cmdlet for you and place the .\ in front of the file name.

    The documentation on the Getting Started guide (https://msdn.microsoft.com/en-us/library/mt126167.aspx) should be corrected.  It is in error when it is documenting the Import-Module.


    . : | : . : | : . tim

    Friday, April 15, 2016 8:28 PM