Skip to content

Instantly share code, notes, and snippets.

View deejay7's full-sized avatar

Justin deejay7

View GitHub Profile
$Events = Get-WinEvent -LogName Security -MaxEvents 10
foreach ($Event in $Events) {
$MessageLineArray = $Event.Message -split "`r`n"
if ($MessageLineArray.Count -ge 1) {
$MessageLineArray[0]
}
}
@dkittell
dkittell / PictureRename.ps1
Last active August 21, 2024 14:30
PowerShell – Rename Pictures to Image Taken Date/Time with Dimensions
<#
.SYNOPSIS
Renames pictures.
.DESCRIPTION
The Rename-Pictures cmdlet to rename pictures to a format where the file creation time is first
in the name in this format: . The idea is that
.PARAMETER Path
Specifies the path to the folder where image files are located. Default is current location (Get-Location).
@tathamoddie
tathamoddie / RequiresPowerShell.bat
Created August 5, 2010 03:48
Batch file to automatically detect, download and install PowerShell 2 on to an XP SP3 machine
@echo off
REM If PowerShell 2 is not installed, this script will automatically download and install it.
REM Only works on XP SP3 with .NET 3.5. Only for dev boxes, not designed for servers.
REM Based on http://blog.codeassassin.com/2009/12/10/no-web-browser-need-powershell/
ver | find "XP" > nul
if %ERRORLEVEL% neq 0 goto not_xp
ver | find "5.1.2600" > nul