Skip to content

Instantly share code, notes, and snippets.

View AmarJazzz's full-sized avatar

Amarnath Mahato AmarJazzz

View GitHub Profile
@AmarJazzz
AmarJazzz / Check-SoftwareInstalled.ps1
Created February 10, 2023 15:56
Find if a Software is installed on the system or not
Function Check-SoftwareInstalled {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$SoftwareName
)
$uninstallKey = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall'
$registry = Get-Item -Path $uninstallKey
if (!$registry) {
Write-Error "Error: Registry key $uninstallKey not found."
@AmarJazzz
AmarJazzz / ByPass-ExecutionPolicy.ps1
Created May 6, 2020 08:47
This script shows the different ways to ByPass execution Policies in Powershell
$ScriptPath = "D:\test.ps1"
# Step1
Get-Content $ScriptPath | Powershell -noprofile -
# Step2
Powershell -ExecutionPolicy Bypass -File $ScriptPath
# Step3
Get-Content $ScriptPath | Invoke-Expression
@AmarJazzz
AmarJazzz / Reverse-String.ps1
Created December 18, 2019 15:44
This script is used for reversing the String.
Function Reverse-String
{
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]$Phrase
)
$StrText = $Phrase.ToCharArray()
([array]::Reverse($StrText))
$output = $StrText -join ""
@AmarJazzz
AmarJazzz / Get-WiFiPassword.ps1
Created October 4, 2017 06:20
This script fetches the password in plain text which is mapped to a particular SSID in your computer
Function Get-WIFIPass
{
$output = netsh.exe wlan show profiles
$ssidProfiles = $output | Select-String -Pattern 'All User Profile' -AllMatches
$ssidNetwork = ($ssidProfiles -split ": ").Trim() | % {
if ($_ -ne 'All User Profile')
{
$getPW = netsh.exe wlan show profiles name="$_" key=clear
$pw = $getPW | Select-String -Pattern 'Key Content'
if($pw -eq $null)
7/4/2017 12:32:28 AM 3B76C30834DB4F8C88A339D1B4BA3196.MAI Msg:Passed-ClientIPNotLocal AuthStatus:0
ClientIP:187.181.39.60
Sender: xkkah@abc.com Recipients: geral@askdj.com
7/4/2017 12:34:17 AM 8027F8A703654CB2B204C3C460C7582A.MAI Msg:Passed-ClientIPNotLocal AuthStatus:0
ClientIP:212.233.216.133
Sender: xfccwz@dfs.state.fl Recipients: info@infinitytech.com
7/4/2017 12:35:14 AM 0DC7EBDE5C444E7F9A3908DEB267ED6C.MAI Msg:Passed-ClientIPNotLocal AuthStatus:0
ClientIP:209.85.220.194
Sender: eutech2055@mail.com Recipients: admin@srr.in,principal@srr.in
7/4/2017 12:35:23 AM 070F64522B6847E59BC633940C3D0C19.MAI Msg:Passed-ClientIPNotLocal AuthStatus:0
@AmarJazzz
AmarJazzz / IE-Sample.ps1
Created January 2, 2017 07:47
Test Script
##-----[ SCRIPT BY AMAR ]-------###
$URL = "https://www.sslshopper.com/ssl-checker.html#hostname=216.58.199.174"
$iexplorer = New-Object -ComObject "internetexplorer.application"
$iexplorer.visible = $true
$iexplorer.navigate($URL)
Start-Sleep -Seconds 10
$Output = $iexplorer.Document.getElementsByTagName("td") | ?{$_.innerText -imatch "Common name:"} | Select outerText
$Output
@AmarJazzz
AmarJazzz / Random-Cmdlets.ps1
Created December 27, 2016 14:45
CmdLet of the Day
#===[ START OF SCRIPT ]===#
# Title in the PowerShell Console
Write-Host "`nHere is your Powershell Cmdlet of the Day`n`n" -ForegroundColor Yellow
# Choosing a Random Powershell Cmdlet
$RandomCmdlet = gcm * -CommandType Cmdlet | Get-Random
$help = Get-Help $RandomCmdlet.Name -Full
# Function to Convert Help Description to String
@AmarJazzz
AmarJazzz / Deploy-Application.ps1
Created November 23, 2016 12:58
This script performs the installation or uninstallation of an application(s).
<#
.SYNOPSIS
This script performs the installation or uninstallation of an application(s).
.DESCRIPTION
The script is provided as a template to perform an install or uninstall of an application(s).
The script either performs an "Install" deployment type or an "Uninstall" deployment type.
The install deployment type is broken down into 3 main sections/phases: Pre-Install, Install, and Post-Install.
The script dot-sources the AppDeployToolkitMain.ps1 script which contains the logic and functions required to install or uninstall an application.
.PARAMETER DeploymentType
The type of deployment to perform. Default is: Install.
@AmarJazzz
AmarJazzz / Perl_Log_Script.pl
Created November 11, 2016 10:51
Perl Log sample script
###########################
## LOG SCRIPT ##
## Written by :- AMAR ##
###########################
#!/usr/bin/perl
use Net::SSH::Expect;
use POSIX qw(strftime);
@AmarJazzz
AmarJazzz / Taking_SnapShot.ps1
Created October 18, 2016 07:56
Taking Snapshot of System Properties
#======================================#
## SCRIPT WRITTEN BY : AMAR HELLOWEEN ##
#======================================#
#----- Defining Function and Loading Assemblies -----#
#====================================================#
Add-Type –AssemblyName System.Windows.Forms
[Reflection.Assembly]::LoadWithPartialName("System.Drawing") | out-null