{"id":1036,"date":"2023-05-23T08:21:33","date_gmt":"2023-05-23T08:21:33","guid":{"rendered":"https:\/\/mustafauzun.co\/blog\/?p=1036"},"modified":"2023-05-23T08:21:33","modified_gmt":"2023-05-23T08:21:33","slug":"powershell-application-checker-script","status":"publish","type":"post","link":"https:\/\/mustafauzun.co\/blog\/powershell-application-checker-script\/","title":{"rendered":"Powershell, Application Checker Script"},"content":{"rendered":"\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\" data-file=\"Checker.ps1\"><code>Write-Host &quot;[Application Checking]&quot;\n\n$informationTexts = @{\n    Success = @{Text = &quot;Success&quot;; BackgroundColor = &quot;DarkGreen&quot;}\n    Error = @{Text = &quot;Error&quot;; BackgroundColor = &quot;DarkRed&quot;}\n}\n\n$appList = @(\n                @{Name=&quot;Notepad++&quot;; Path=&quot;$env:ProgramW6432\\Notepad++&quot;},\n                @{Name=&quot;Url Rewrite&quot;; Path=&quot;$env:SystemRoot\\system32\\inetsrv\\rewrite.dll&quot;},\n                @{Name=&quot;Google Chrome&quot;; Path=&quot;$env:ProgramW6432\\Google\\Chrome&quot;},\n                @{Name=&quot;Java 8&quot;; Path=&quot;registry::HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8\\&quot;}\n            )\n\nforeach($app in $appList)\n{\n    Write-Host $app.Name -NoNewLine\n    Write-Host &quot; - &quot; -NoNewLine\n    $checkApplicationPath = Test-Path -Path $app.Path\n    if($checkApplicationPath)\n    {\n        Write-Host $informationTexts.Success.Text -BackgroundColor $informationTexts.Success.BackgroundColor\n    }\n    else\n    {\n        Write-Host $informationTexts.Error.Text -BackgroundColor $informationTexts.Error.BackgroundColor\n    }\n}\n\n$getDotNetFramework = (get-childitem -path &quot;HKLM:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP&quot; | Where-Object -FilterScript {$_.name -match &quot;v4.7&quot;} | Get-ItemProperty).Install\n\nWrite-Host &quot;.NET Framework 4.7&quot; -NoNewLine\nWrite-Host &quot; - &quot; -NoNewLine\nif($getDotNetFramework -eq $true)\n{\n    Write-Host $informationTexts.Success.Text -BackgroundColor $informationTexts.Success.BackgroundColor\n}\nelse\n{\n    Write-Host $informationTexts.Error.Text -BackgroundColor $informationTexts.Error.BackgroundColor\n}\npause<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":1034,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"class_list":["post-1036","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"_links":{"self":[{"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/posts\/1036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/comments?post=1036"}],"version-history":[{"count":1,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/posts\/1036\/revisions"}],"predecessor-version":[{"id":1037,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/posts\/1036\/revisions\/1037"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/media\/1034"}],"wp:attachment":[{"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/media?parent=1036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/categories?post=1036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mustafauzun.co\/blog\/wp-json\/wp\/v2\/tags?post=1036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}