Skip to content

Instantly share code, notes, and snippets.

@derekables
derekables / Get-RedditFeed.ps1
Last active March 17, 2016 05:07
r/Powershell Daily Challenge - 3/17/16 (A VERY simple/quick example)
<#
.Synopsis
Get the recently posted news on the front page of Reddit! Alternatively, target a subreddit
.DESCRIPTION
Get the recently posted news on the front page of Reddit! Alternatively, target a subreddit
.EXAMPLE
Get-RedditFeed -NumberOfResults 10
.EXAMPLE
Get-RedditFeed -SubReddit r/Powershell -NumberOfResults 5
#>
@derekables
derekables / Remove-DuplicateDownloads.ps1
Created March 12, 2016 23:44
r/Powershell Daily Challenge - 3/12/15
<#
.Synopsis
Deletes all files in a specific directory with "(n)" in their name (where 'n' indicates a number). Useful for cleaning up downloads
.DESCRIPTION
Deletes all files in a specific directory with "(n)" in their name (where 'n' indicates a number). Useful for cleaning up duplicate downloads
.EXAMPLE
Remove-DuplicateDownloads -TargetPath C:\Users\User1\Downloads
#>
function Remove-DuplicateDownloads
{
@derekables
derekables / Get-Diacritic.ps1
Last active March 8, 2016 23:17
Powershell.org Scripting Games - March - Advanced
<#
.Synopsis
Find files with names that contain diacritical marks, and send this list to a specified email address.
#>
function Get-Diacritic {
[CmdletBinding()]
Param
(
[Parameter(ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
@derekables
derekables / March-Advanced.ps1
Created March 8, 2016 23:04
Powershell.org Scripting Games - March - Advanced
<#
.Synopsis
Find files with names that contain diacritical marks, and send this list to a specified email address.
#>
function Get-Diacritic {
[CmdletBinding()]
Param
(
[Parameter(ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true,
@derekables
derekables / March-Beginner.ps1
Last active March 7, 2016 00:59
Powershell.org Scripting Games - March - Beginner
Get-ChildItem '.\FileShare' -Recurse | Where {$_.Name -match "[\u00C0-\u00FF]"} | ft @{Expression={$_.Name};Label="File Name";width=20},@{Expression={$_.Directory};Label="Directory";width=22},@{Expression={$_.CreationTime};Label="Created";width=20},@{Expression={$_.LastWriteTime};Label="Last Modified";width=21},@{Expression={$_.Length};Label="Size";width=8}