none
update-engines.ps1 task hangs, require user input for file replacement RRS feed

  • Question

  • I’m running script update-engines.ps1, it never complete successfully.  It comply  successfully only first time.

    If I run it manually, it require  conformation on file replacement.

    I modify line :

    Copy-Item $manifestPath -Destination $fullPkgDir -Force -Confirm:$false

    And under function

    New-Item -type Directory $path -force -Confirm:$false

     

    It wont to confirm Copy and replace .flowing files : nvcmacros.def.cab, nvcincr.def.cab, etc

    Location of script : https://support.microsoft.com/en-us/kb/2292741

    Problem is : $destination.CopyHere($source.item($i), $flags)

    I have try to set flags : 4,10,16,20 and it did  not help.


    • Edited by MaliStane Friday, April 24, 2015 2:24 PM find error
    • Moved by Joyce L Monday, April 27, 2015 3:14 AM move
    Friday, April 24, 2015 10:53 AM

Answers

All replies

  • Hi MaliStane,

    Would you please locate the line which needs user to interact, please also post the content of confirm.

    And the two cmdlets "Copy-Item" and "New-Item" seems ok for me, the "Remove-Item" cmdlet always prompt the comfirm message if you want to delete a folder and haven't specified the parameter "-Recurse".

    In addition, to work with confirmation in powershell script, you can also refer to the variable "$ConfirmPreference", for more detailed information, please refer to this article:

    http://blogs.msdn.com/b/powershell/archive/2006/12/15/confirmpreference.aspx

    If there is anything else regarding this issue, please feel free to post back.

    Best Regards,

    Anna Wang


    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

    Tuesday, April 28, 2015 7:32 AM
    Moderator
  • Hi AnnaWY,

    Problematic is flowing, when there is no updates... :

                # If the file inside the zip file should be extracted
                # to a subfolder, then we need to reset the destination
                if ($lastPathIndex -gt $cabNameLength)
                {
                    $relativePath = $source.item($i).Path.SubString(($cabNameLength + 1), ($lastPathIndex - $cabNameLength))
                    $relativeDestDir = $destinationDirectory + $relativePath
                    
                    if ($relativeDestDir -ne $cachedDestDir)
                    {
                        $relativeDest = $shell.Namespace($relativeDestDir)
                        $cachedDestDir = $relativeDestDir
                    }
                    
                    $relativeDest.CopyHere($source.item($i), $flags)
                }
                else
                {
                   $destination.CopyHere($source.item($i), $flags)
                }
            }
        }
    }

    Tuesday, April 28, 2015 8:31 AM
  • Tuesday, April 28, 2015 12:58 PM
    Moderator