This file contains hidden or 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
#!/usr/bin/env ruby | |
# | |
# Convert blogger (blogspot) posts to jekyll posts | |
# | |
# Basic Usage | |
# ----------- | |
# | |
# ./blogger_to_jekyll.rb feed_url | |
# | |
# where `feed_url` can have the following format: |
This file contains hidden or 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
ipmo PSDesiredStateConfiguration | |
# Reveal non-Exported commands in a module | |
$m = Get-module PSDesiredStateConfiguration | |
& $m {Get-Command -module PSDesiredStateConfiguration} |
This file contains hidden or 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-Uptime { | |
[timespan]::FromSeconds([double][System.Diagnostics.Stopwatch]::GetTimestamp() / [double][System.Diagnostics.Stopwatch]::Frequency) | |
} |
This file contains hidden or 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 -Version 3 | |
# http://powershell.com/cs/blogs/tips/archive/2016/02/17/getting-an-excuse.aspx | |
function Get-Excuse | |
{ | |
$url = 'http://pages.cs.wisc.edu/~ballard/bofh/bofhserver.pl' | |
$ProgressPreference = 'SilentlyContinue' | |
$page = Invoke-WebRequest -Uri $url -UseBasicParsing | |
$pattern = '(?m)<br><font size = "\+2">(.+)' | |
if ($page.Content -match $pattern) | |
{ |
This file contains hidden or 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 -Version 2 | |
#http://powershell.com/cs/blogs/tips/archive/2016/02/11/send-text-to-notepad.aspx | |
function Out-Notepad | |
{ | |
param | |
( | |
[Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
[String] | |
[AllowEmptyString()] | |
$Text |
This file contains hidden or 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
$Regex = [regex]'<strong>Updated\s01/20/2016</strong>' | |
do { | |
$Site = Invoke-WebRequest -Uri 'https://blogs.msdn.microsoft.com/powershell/2015/12/23/windows-management-framework-wmf-5-0-currently-removed-from-download-center/' | |
Start-Sleep -Seconds 60 | |
} while ($Site.Content -match $Regex) | |
while (1) { | |
[System.Console]::Beep() | |
Get-Command -Name Write* -CommandType Cmdlet | Where-Object {$_.Name -notmatch 'Event|Progress|Debug'} | ForEach-Object { | |
Invoke-Expression "$($_.Name) 'There is news on WMF 5.0' -Verbose" | |
} |
This file contains hidden or 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
#http://www.powershellmagazine.com/2014/07/08/pstip-converting-to-the-local-time/ | |
# Convert a time to local time | |
[System.TimeZone]::CurrentTimeZone.ToLocalTime("Tuesday, February 2, 2016 2:48:39 PM") | |
# Convert a time to UTC time | |
[System.TimeZone]::CurrentTimeZone.ToUniversalTime("2016/02/10 01:00 PM") | |
# Get the Daylight Name | |
[System.TimeZone]::CurrentTimeZone.DaylightName |
This file contains hidden or 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
$env:path -split ";"|sort |
This file contains hidden or 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
<# PowerShell.Com | |
PowerShell can use UIAutomation calls to find out useful UI information about any process. | |
You can find out whether a process accepts keyboard input, whether it is currently visible | |
(and what its window dimensions are), and whether it is a native Win32 application | |
or uses WPF--among other things. | |
Here is an example that examines two processes: the PowerShell window, and a minimized Notepad: |
This file contains hidden or 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
#https://technet.microsoft.com/en-us/library/hh849757.aspx | |
Test-ComputerSecureChannel -Credential contoso.local\admin -Repair |