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
gwmi Win32_OperatingSystem -cn localhost | select PSC*, S*aj*, V*, @{N='BIOSSerial';E={(gwmi Win32_Bios -cn $_.__Server).SerialNumber}} |
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
# Speeds are measured in milliseconds and are the average over 256 test runs | |
# 6.3 ms | |
Get-ADUser -Filter { SamAccountName -eq $user } | |
# 6.7 ms | |
Get-AdUser -LDAPFilter "(SamAccountName=$user)" | |
# 8.5 ms | |
Get-ADUser -Identity $user |
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-RSSFeed | |
{ | |
<# | |
.SYNOPSIS | |
Gets data from a RSS Feed. | |
.DESCRIPTION | |
The Get-RSSFeed function retrieves the title, link and excerpt from a specified rss feed. | |
Multiple URIs can be provided as parameters or piped to the function. |
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
$list = @" | |
1 Partridge in a pear tree | |
2 Turtle Doves | |
3 French Hens | |
4 Calling Birds | |
5 Golden Rings | |
6 Geese a laying | |
7 Swans a swimming | |
8 Maids a milking | |
9 Ladies dancing |
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
Verifying that +windos is my blockchain ID. https://onename.com/windos |
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
# Set powershell job to run Weekly, on on the desired day. | |
# Wrap the code the job is running with the below so that it will only run | |
# when intended. | |
# e.g. Last Wednesday of month: | |
# | |
# $DayToRun = 'Wednesday' | |
# Occurance = -1 | |
# | |
# The scheduled job still runs once a week, but will only execute your code | |
# if the date is validated. |
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
# Beginner Puzzle | |
(Get-ChildItem C:\FileShare -Recurse).Where({$_.Name -match "[\u00C0-\u00FF]"}) | | |
Select-Object -Property Name, | |
Directory, | |
@{n="Creation Date";e={$_.CreationTime}}, | |
@{n="Last Modification Date";e={$_.LastWriteTime}}, | |
@{n="File Size";e={$_.Length}} | | |
Format-Table |
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
# Dumb | |
$Count = ($ADComputer | Measure-Object).Count | |
$Random = Get-Random -Minimum 0 -Maximum $Count | |
$CandidateComputer = $ADComputer[$Random] | |
# Smart | |
$CandidateComputer = Get-Random -InputObject $ADComputer |
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
$ThemeLists = 'http://putty.org.ru/themes/index.html', 'http://putty.org.ru/themes/page2.html', 'http://putty.org.ru/themes/page3.html', 'http://putty.org.ru/themes/page4.html', 'http://putty.org.ru/themes/page5.html' | |
foreach ($Uri in $ThemeLists) | |
{ | |
$Content = Invoke-WebRequest -Uri $Uri | |
$List = $Content.ParsedHtml.getElementsByTagName('ol') | |
$Links = $List[0] | foreach {$_.getElementsByTagName('a') | where {$_.textContent -ne $null} } | |
foreach ($Link in $Links) | |
{ |
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
$path = 'HKCU:\Software\Microsoft\Internet Explorer\Main\' | |
#First page | |
$name = 'start page' | |
$value = 'https://www.google.com/?gws_rd=ssl' | |
Set-Itemproperty -Path $path -Name $name -Value $value | |
#Additional pages | |
$name = 'Secondary Start Pages' | |
$value = @('https://secondpage.com/', 'https://thirdpage.co.nz') |
OlderNewer