This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scriptPath = "https://raw.githubusercontent.com/gabriel-vanca/PowerShell_Library/main/Scripts/Windows/Software/close_program.ps1" | |
$WebClient = New-Object Net.WebClient | |
$close_program = $WebClient.DownloadString($scriptPath) | |
$close_program_sb = [Scriptblock]::Create($close_program) | |
$param1 = "Windows Terminal" | |
$param2 = "WindowsTerminal" | |
$param3 = "WindowsTerminal" | |
Invoke-Command -ScriptBlock $close_program_sb -ArgumentList ($param1, $param2, $param3) -NoNewScope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$repoDownloadLocalPath = "$env:Temp\WinGet" | |
#Ensure download folder is empty | |
if (Test-Path -path $repoDownloadLocalPath) { | |
Remove-Item $repoDownloadLocalPath -Recurse -Force | |
} | |
$repoUrl = "https://github.com/gabriel-vanca/WinGet" | |
git clone $repoUrl $repoDownloadLocalPath --depth 1 --progress -v | |
Get-ChildItem $repoDownloadLocalPath -Recurse | Unblock-File | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test Command Existence | |
function Test-CommandExists { | |
[CmdletBinding()] | |
param | |
( | |
[Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] $command | |
) | |
$exists = $null -ne (Get-Command $command -ErrorAction SilentlyContinue) | |
return $exists | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Retries a Powershell command n-times upon failure. | |
.DESCRIPTION | |
The cmdlet is capable of retrying a PowerShell command passed as a [ScriptBlock] according to the user defined number of retries and time between retries. | |
.PARAMETER ScriptBlock | |
PoweShell command(s) as a ScriptBlock that will be executed and retried in case of Errors. | |
Make sure the script block throws an error when it fails, otherwise the cmdlet won't run the retry logic. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Get the license status of a Windows computer | |
.DESCRIPTION | |
Gets the license details via SLMGR.vbs /dlv | |
.EXAMPLE | |
Get-WindowsLicenseInfo | |
Returns the license details of the local computer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MS Security bulletin: https://learn.microsoft.com/en-us/security-updates/SecurityAdvisories/2015/3009008 | |
# NOTE: This registry change requires that the system be restarted. | |
Function Test-RegKeyExists { | |
param ( | |
$key | |
) | |
If (!(Test-Path -Path $key)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Test-Port { | |
<# | |
.SYNOPSIS | |
Tests a Port or a range of ports on a specific ComputerName(s). | |
.DESCRIPTION | |
Tests a Port or a range of ports on a specific ComputerName(s). Creates a custom object with the properties: ComputerName, Protocol, Port, Open, Notes. | |
.PARAMETER ComputerName | |
A single ComputerName or array of ComputerName to test the port connection on. Aliased to 'CN', 'Server' | |
.PARAMETER Port | |
Port number to test ([int16] 0 - 65535), an array can also be passed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-SysInfo { | |
<# | |
.SYNOPSIS | |
Gether system inforamtion | |
.DESCRIPTION | |
Gather information such as the Computer Name, OS, Memory Information, Disk Information and CPU Information on a local or remote system. | |
.PARAMETER Computer | |
The local or remote system to gather information from | |
#> | |
[CmdletBinding()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-InstalledDotNet { | |
<# | |
.SYNOPSIS | |
Display version of .net installed on a system | |
.DESCRIPTION | |
Query the registry on a local or remote system to display the version of .net installed | |
.PARAMETER ComputerName | |
The name of the computer to run the query on | |
#> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-SystemSoftware{ | |
<# | |
.SYNOPSIS | |
Gather software installed on a local or remote device | |
.DESCRIPTION | |
Gather Software and information about the software installed on a local or remote device using the registry or WMI | |
.PARAMETER ComputerName | |
Computer to gather software on | |
.PARAMETER QueryType | |
Specify how you want to gather the information |
OlderNewer