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
<# | |
.SYNOPSIS | |
Converts files to the given encoding. | |
Matches the include pattern recursively under the given path. | |
.EXAMPLE | |
Convert-FileEncoding -Include *.js -Path scripts -Encoding UTF8 | |
#> | |
function Convert-FileEncoding([string]$Include, [string]$Path, [string]$Encoding='UTF8') { | |
$count = 0 |
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 Trace-Route { | |
<# | |
.SYNOPSIS | |
Trace the route between source computer and a target machine. | |
.DESCRIPTION | |
Trace the route between source computer and a target machine. | |
.EXAMPLE | |
Trace-Route Computer01 | |
Perform trace route to Computer01 | |
.EXAMPLE |
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
#Based on <http://gallery.technet.microsoft.com/scriptcenter/Get-PendingReboot-Query-bdb79542> | |
function Test-RebootRequired | |
{ | |
$result = @{ | |
CBSRebootPending =$false | |
WindowsUpdateRebootRequired = $false | |
FileRenamePending = $false | |
SCCMRebootPending = $false | |
} |
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
# This is a super **SIMPLE** example of how to create a very basic powershell webserver | |
# 2019-05-18 UPDATE — Created by me and and evalued by @jakobii and the comunity. | |
# Http Server | |
$http = [System.Net.HttpListener]::new() | |
# Hostname and port to listen on | |
$http.Prefixes.Add("http://localhost:8080/") | |
# Start the Http Server |
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
# This is the public script we call as an entry point into the deployment / configuration process | |
Function Invoke-Deployment | |
{ | |
Param | |
( | |
$ApplicationPool, | |
$WebSite | |
) | |
Invoke-AppPoolTasks @PSBoundParameters |
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
<# | |
.Synopsis | |
Gets client IP collection from IIS logs | |
.DESCRIPTION | |
Extracts the Client IP addresses from IIS logs, and returns the unique addresses | |
found. Optionally, it will include counts of how many times each address appeared | |
in the logs, by enabling the -Count switch. If -Count is enabled you can return either | |
a collection of PS objects having ClientIP and Count properties, or a hash table of the | |
ip addresses and counts by using the -AsHash switch. | |
.PARAMETER Path |
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
Get-PrinterDriver | Select-Object Name,@{ | |
n="DriverVersion";e={ | |
$ver = $_.DriverVersion | |
$rev = $ver -band 0xffff | |
$build = ($ver -shr 16) -band 0xffff | |
$minor = ($ver -shr 32) -band 0xffff | |
$major = ($ver -shr 48) -band 0xffff | |
"$major.$minor.$build.$rev" |
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
# SVN Export Script | |
# | |
# Given an SVN URL and local directory path, this script copies all files from | |
# SVN into the specified local directory. | |
# | |
# Uses SharpSVN DLL v1.7002.1998 (Documentation : http://docs.sharpsvn.net/current/) | |
# | |
# Takes two command line arguments, an SVN URL and a local directory path. | |
param ([string]$svnUrl = $(read-host "Please specify the path to SVN"), | |
[string]$svnLocalPath = $(read-host "Please specify the local path"), |
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
Get-ChildItem Cert:\LocalMachine\Root | Where-Object {$_.Subject -eq 'CN=SubjectName'} | Foreach-Object { [system.IO.file]::WriteAllBytes("C:\SSL\SubjectName.pfx",($_.Export('PFX', 'p@ssw0rd')) ) } |
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.0 | |
#Requires -Module DnsClient,ActiveDirectory | |
<# | |
.SYNOPSIS | |
Practice Event of Powershell Winter Scripting 2014 | |
.DESCRIPTION | |
Practice Event of Powershell Winter Scripting 2014 |
OlderNewer