uninstall software

This topic contains 2 replies, has 3 voices, and was last updated by Profile photo of Kyle Berger Kyle Berger 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #43146
    Profile photo of Efff dd
    Efff dd
    Participant

    PSD1 file – I have "environment = dev"
    RemovePackages = @(
    @{
    ShortName = "GAC_101"
    Name = 'GACInstaller'
    Path = "\\domain.com\files\Hosting\Config\package.msi"
    ProductID = '777777-7-7-7-7-7-7'
    Environment = 'Dev'
    Ensure = 'Absent'

    ========
    ps1 FILE – HOW CAN I USE THAT "ENVIRONMENT" VARIABLE NOW TO REMOVE SOFTWARE IS IT MATCHES?

    foreach ($Package in $Node.RemovePackages)
    {
    $PackageName = "Baseline_Remove_Package_" + $Package.ShortName
    Package $PackageName
    {
    Name = $Package.Name
    Path = $Package.Path
    Arguments = $Package.Arguments
    ProductID = $Package.ProductID
    Ensure = $Package.Ensure
    }
    }

    #43297
    Profile photo of Don Jones
    Don Jones
    Keymaster

    I'm sorry – I don't understand the question. I'm not familiar with using a manifest to set variables. Can I ask why you're doing that?

    #45204
    Profile photo of Kyle Berger
    Kyle Berger
    Participant

    I think you mean:

    foreach ($Package in ($Node.RemovePackages | ?{$_.Environment -eq 'Dev'}))
    {
        $PackageName = "Baseline_Remove_Package_" + $Package.ShortName
        Package $PackageName
        {
            Name = $Package.Name
            Path = $Package.Path
            Arguments = $Package.Arguments
            ProductID = $Package.ProductID
            Ensure = $Package.Ensure
        }
    }
    
Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.