tutass.blogg.se

Using powershell to install software
Using powershell to install software







using powershell to install software

Need to know the name of software installed? Use the same query to print matching results: (gp HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*). ((gp HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*).DisplayName -Match "Core Runtime - 3.1").Length -gt 0 But be careful: you might match more then a single installation! So we need to evaluate the result differently and do a -gt 0 to see if there are results. If you need to match a partial name, you can use the -Match option. NET Core Runtime - 3.1.0 (圆4)" Need to check a partial name? If you really want to hurt yourself need something smaller, check this one-liner: (gp HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*).DisplayName -Contains "Microsoft. The script is both readable and easy to understand. Write-Host "'$software' NOT is installed." $installed = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where ) -ne $null The path you want to query is HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*. PowerShell makes it really easy to query the registry using Get-ItemProperty. You could check if a specific file is present at a certain location, but there is a better way: the uninstall database in the Windows Registry!

using powershell to install software

Some deployment scripts need to check if certain required software is installed on a Windows Machine. Go to the Actions Tab New action with following parameters: Action Start a program Program script: powershell Add arguments (optional): -File specify.









Using powershell to install software