Skip to content

Instantly share code, notes, and snippets.

View bwya77's full-sized avatar
📱
Message me on Telegram @bwya77

Bradley Wyatt bwya77

📱
Message me on Telegram @bwya77
View GitHub Profile
@PlagueHO
PlagueHO / Update-AzureModules.ps1
Last active July 19, 2019 01:32
Update all Azure PowerShell modules safely
Get-Module -Name azure* -ListAvailable |
Where-Object -Property Name -ne 'AzureRM' |
ForEach-Object {
$currentVersion = [Version] $_.Version
$newVersion = [Version] (Find-Module -Name $_.Name).Version
if ($newVersion -gt $currentVersion) {
Write-Host -Object "Updating $_ Module from $currentVersion to $newVersion"
Update-Module -Name $_.Name -RequiredVersion $newVersion -Force
Uninstall-Module -Name $_.Name -RequiredVersion $currentVersion -Force
}
@SMSAgentSoftware
SMSAgentSoftware / New-WPFMessageBox
Last active September 6, 2024 02:32
PowerShell function to display a customizable WPF message box / window
Function New-WPFMessageBox {
# For examples for use, see my blog:
# https://smsagent.wordpress.com/2017/08/24/a-customisable-wpf-messagebox-for-powershell/
# CHANGES
# 2017-09-11 - Added some required assemblies in the dynamic parameters to avoid errors when run from the PS console host.
# Define Parameters
[CmdletBinding()]
@danieltharp
danieltharp / DangItBobby.ps1
Created April 6, 2016 22:14
PowerShell script to find where a user is logged into on the network and disable their NIC.
# ********************************************************************************
#
# Script Name: DangItBobby.ps1
# Version: 1.0.0
# Author: bluesoul <https://bluesoul.me>
# Date: 2016-04-06
# Applies to: Domain Environments
#
# Description: This script searches for a specific, logged on user on all or
# specific Computers by checking the process "explorer.exe" and its owner. It
Function Create-Form
{
#Calling the Assemblies
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
# Create the Conatainer Form to place the Labels and Textboxes
$Form = New-Object “System.Windows.Forms.Form”;
$Form.Width = 500;
$Form.Height = 400;
$Form.Text = 'Enter the required details'