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
# Written for Spadam22 | |
# Define some log search intervals. | |
# Steart from today as the end date for the search | |
$end = Get-Date | |
$start = $end.AddDays(-10) | |
# Create a lookup table for groups | |
$groups = @{} | |
# Find all groups, and for each group |
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 Find-Software { | |
[CmdletBinding()] | |
param ( | |
<# | |
The name, or part of a name, of a package. | |
Should be enough to get a unique match or the results will get really messy. | |
#> | |
[Parameter(Mandatory)] | |
[Alias('Name')] |
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
#Requires -PSEdition Desktop | |
[CmdletBinding()] | |
param ( | |
[ValidateSet('AllUsers', 'CurrentUser')] | |
[string] | |
$Scope = 'CurrentUser' | |
) | |
$ErrorActionPreference = 'Stop' |
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
Add-Type -TypeDefinition @' | |
using System.Runtime.InteropServices; | |
using System.Text; | |
public class Native | |
{ | |
[DllImport("kernel32.dll", SetLastError = true)] | |
public static extern uint QueryDosDevice( | |
string lpDeviceName, | |
StringBuilder lpTargetPath, |
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
Add-Type -TypeDefinition ' | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
public class UserProfile | |
{ | |
[DllImport("userenv.dll")] | |
public static extern int CreateProfile( | |
[MarshalAs(UnmanagedType.LPWStr)] string pszUserSid, |
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
#Requires -Modules PSKoans | |
Describe "Register-Advice" { | |
BeforeAll { | |
$module = @{ | |
ModuleName = 'PSKoans' | |
} | |
} | |
Context "Profile Folder/File Missing" { |
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
enum Visibility : byte { | |
Default = 0 | |
Hide = 1 | |
Show = 2 | |
} | |
function Convert-CeaserCipher { | |
<# | |
.SYNOPSIS | |
Convert a string to and from a ceaser cipher (ROT-13) encoding. |
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
############################################################################################################################################################## | |
# IANA # | |
############################################################################################################################################################## | |
# | |
# Address family | |
# | |
New-Enum -ModuleBuilder $IndentedDnsMB -Name "Indented.Dns.IanaAddressFamily" -Type "UInt16" -Members @{ | |
IPv4 = 1; # IP version 4 |
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
# Chocolatey must be installed on all nodes which intend to use it | |
https://chocolatey.org/install#individual | |
# Make a folder called DhcpDaemon | |
New-Item DhcpDaemon -ItemType Directory | |
# Inside that folder, make a folder called Tools | |
# This will hold your installation files and an install script | |
New-Item DhcpDaemon\tools -ItemType Directory | |
# Make an install script |
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 Watch-WinEvent { | |
<# | |
.SYNOPSIS | |
Watch for events matching a query in the event log. | |
.DESCRIPTION | |
Watch for events matching a query in the event log. | |
#> |
NewerOlder