Announcement

Collapse
No announcement yet.

the same command on same machine not run

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • the same command on same machine not run

    I successfully run PS yesterday. Took a copy.
    Today when run the same command on the same machine getting trouble. Tried different combinations. No luck...
    Why it is not consistent? And plz suggestion...

    Yesterday:

    PS C:\nano-new> New-NanoServerImage -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -TargetPath .\Nano1 -ComputerName Nano1 –GuestDrivers

    cmdlet New-NanoServerImage at command pipeline position 1
    Supply values for the following parameters:

    Windows(R) Image to Virtual Hard Disk Converter for Windows(R) 10
    Copyright (C) Microsoft Corporation. All rights reserved.
    Version 10.0.9000.0.amd64fre.fbl_core1_hyp_dev(mikekol).14 1224-3000 Beta


    Today:

    PS C:\NANO-New> New-NanoServerImage -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -TargetPath .\Nano1 -ComputerName
    Nano1 –GuestDrivers
    New-NanoServerImage : The term 'New-NanoServerImage' is not recognized as the name of a cmdlet, function, script file,
    or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
    try again.
    At line:1 char:1
    + New-NanoServerImage -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -TargetPat ...
    + ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (New-NanoServerImage:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


    Suggestion [3,General]: The command New-NanoServerImage was not found, but does exist in the current location. Windows P
    owerShell does not load commands from the current location by default. If you trust this command, instead type ".\New-Na
    noServerImage". See "get-help about_Command_Precedence" for more details.
    PS C:\NANO-New>
    PS C:\NANO-New>

    Tried Suggestion:

    PS C:\NANO-New> ".\New-NanoServerImage" -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -TargetPath .\Nano1 -ComputerN
    ame Nano1 –GuestDrivers
    At line:1 char:25
    + ".\New-NanoServerImage" -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -Targe ...
    + ~~~~~~~~~~
    Unexpected token '-MediaPath' in expression or statement.
    At line:1 char:36
    + ".\New-NanoServerImage" -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -Targe ...
    + ~~~~~~~~~~~~~~~~~~~~~
    Unexpected token 'C:\NANO-New\ISOsource' in expression or statement.
    + CategoryInfo : ParserError: ( [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : UnexpectedToken

    PS C:\NANO-New>
    PS C:\NANO-New>

    Folder structure:

    in attached file

    Attached Files
    "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

  • #2
    Try this:
    Code:
    .\New-NanoServerImage -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -TargetPath .\Nano1 -ComputerName Nano1 -GuestDrivers
    Notice I didn't include double quotes around the script name.
    Regards,
    Jeremy

    Network Consultant/Engineer
    Baltimore - Washington area and beyond
    www.gma-cpa.com

    Comment


    • #3
      believe it or not...

      today my 2 days ago no dots syntax worked. But : .\ or . .\ just returned the prompt.

      What is the "miracle"? It is very hot outside today . Would the same syntax run tomorrow?

      Look :

      PS C:\nano-new> .\New-NanoServerImage -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -TargetPath .\Nano1 -ComputerName Nano1 –GuestDrivers

      PS C:\nano-new>
      PS C:\nano-new>
      PS C:\nano-new>
      PS C:\nano-new> . .\New-NanoServerImage -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -TargetPath .\Nano1 -ComputerName Nano1 –GuestDrivers

      PS C:\nano-new> New-NanoServerImage -MediaPath C:\NANO-New\ISOsource -BasePath .\Base -TargetPath .\Nano1 -ComputerName Nano1 –GuestDrivers
      cmdlet New-NanoServerImage at command pipeline position 1
      Supply values for the following parameters:

      Windows(R) Image to Virtual Hard Disk Converter for Windows(R) 10
      Copyright (C) Microsoft Corporation. All rights reserved.
      Version 10.0.9000.0.amd64fre.fbl_core1_hyp_dev(mikekol).14 1224-3000 Beta

      WARN : Transcription is already running. No Convert-WindowsImage-specific transcript will be created.

      INFO : Image 1 selected ()...
      INFO : Creating sparse disk...
      INFO : Attaching VHD...
      INFO : Disk initialized with MBR...
      INFO : Disk partitioned...
      INFO : Volume formatted...
      INFO : Access path (F:\) has been assigned...
      INFO : Applying image to VHD. This could take a while...
      INFO : Signing disk...
      INFO : Image applied. Making image bootable...
      INFO : Fixing the Device ID in the BCD store on VHD...
      INFO : Drive is bootable. Cleaning up...
      INFO : Closing VHD...

      INFO : Closing Windows image...
      INFO : Done.
      Done. The log is at:
      C:\Users\ADMINI~1\AppData\Local\Temp\2\New-NanoServerImage.log

      PS C:\nano-new>
      "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

      Comment


      • #4
        Strange... can't say why.... maybe it's a 2016 bug.
        Regards,
        Jeremy

        Network Consultant/Engineer
        Baltimore - Washington area and beyond
        www.gma-cpa.com

        Comment


        • #5
          I run it on Server 2012 R2...

          Just restarted the server to try it one more time...


          It becomes "crazy"...

          It didn't run first time. Gave an error...

          Then I tried .\ and . .\ Both came back with the prompt (without errors).

          And last... run again without dot ...

          And it works...

          see attach.


          Attached Files
          "When you hit a wrong note it's the next note that makes it good or bad". Miles Davis

          Comment


          • #6
            Interesting. Seems like something gets cached or loaded and then you can run it without specifying the directory (that's the .\ does). Not sure what's going on but it might be by design.
            Regards,
            Jeremy

            Network Consultant/Engineer
            Baltimore - Washington area and beyond
            www.gma-cpa.com

            Comment

            Working...
            X