Skip to content

Mustafa Ateş UZUN Blog

mustafauzun.co

  • About
  • Blog
  • Home
  • »
  • Powershell
  • »
  • Powershell, Application Checker Script
  • »
    • May 23, 2023
    • by mustafauzun
  • Powershell

Powershell, Application Checker Script

Write-Host "[Application Checking]"

$informationTexts = @{
    Success = @{Text = "Success"; BackgroundColor = "DarkGreen"}
    Error = @{Text = "Error"; BackgroundColor = "DarkRed"}
}

$appList = @(
                @{Name="Notepad++"; Path="$env:ProgramW6432\Notepad++"},
                @{Name="Url Rewrite"; Path="$env:SystemRoot\system32\inetsrv\rewrite.dll"},
                @{Name="Google Chrome"; Path="$env:ProgramW6432\Google\Chrome"},
                @{Name="Java 8"; Path="registry::HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.8\"}
            )

foreach($app in $appList)
{
    Write-Host $app.Name -NoNewLine
    Write-Host " - " -NoNewLine
    $checkApplicationPath = Test-Path -Path $app.Path
    if($checkApplicationPath)
    {
        Write-Host $informationTexts.Success.Text -BackgroundColor $informationTexts.Success.BackgroundColor
    }
    else
    {
        Write-Host $informationTexts.Error.Text -BackgroundColor $informationTexts.Error.BackgroundColor
    }
}

$getDotNetFramework = (get-childitem -path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP" | Where-Object -FilterScript {$_.name -match "v4.7"} | Get-ItemProperty).Install

Write-Host ".NET Framework 4.7" -NoNewLine
Write-Host " - " -NoNewLine
if($getDotNetFramework -eq $true)
{
    Write-Host $informationTexts.Success.Text -BackgroundColor $informationTexts.Success.BackgroundColor
}
else
{
    Write-Host $informationTexts.Error.Text -BackgroundColor $informationTexts.Error.BackgroundColor
}
pause
Share

Powershell, API Test Script

Powershell, Host Checker Script

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Javascript, Task Queue
  • Javascript, Thread Pool
  • Javascript, Lexical Environment
  • Javascript, Execution Context
  • Javascript, Event Delegation

Recent Comments

No comments to show.

Archives

  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • January 2022

Categories

  • C#
  • CMD
  • CSS
  • HTML
  • JavaScript
  • MongoDB
  • Node.js
  • Podcast
  • Powershell
  • Uncategorized
Theme: Puskar by Template Sell.