none
Variable Issue RRS feed

  • Вопрос

  • Sort of new to powershell and having an issue with the below:

    Get-AppxPackage -AllUsers *Microsoft.Bing* | Export-CSV K:\Package.csv
    $Package = Import-Csv "\\ks-appsrv-02\apps$\Package.csv" | Select -ExpandProperty PackageFullName
    Remove-AppxProvisionedPackage -Online -PackageName $Package

    The first line creates a CSV with any Microsoft AppX package in it containing Microsoft.Bing in the name

    The second line gets the full package name (In this case Microsoft.BingWeather_4.31.11905.0_x64__8wekyb3d8bbwe) and assigns it against the variable $Package

    Now the 3rd line should remove the package but I am getting:

    Remove-AppxProvisionedPackage : The system cannot find the file specified.
    At line:1 char:103
    + ... FullName} | Remove-AppxProvisionedPackage -Online -PackageName $Packa ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Remove-AppxProvisionedPackage], COMException
        + FullyQualifiedErrorId : Microsoft.Dism.Commands.RemoveAppxProvisionedPackageCommand

    If I just ran it as Remove-AppxProvisionedPackage -Online -PackageName Microsoft.BingWeather_4.31.11905.0_x64__8wekyb3d8bbwe it would work so I'm not sure what I'm doing wrong here.

    All help is greatly appreciated.

    21 августа 2019 г. 14:26

Ответы