Skip to content

Instantly share code, notes, and snippets.

openapi: 3.0.3
info:
title: Risk Review
description: |-
description goes here ....
termsOfService: http://swagger.io/terms/
contact:
email: dev@availcarsharing.com
license:
import Adapter from "ember-data/adapters/rest";
export default Adapter.extend();
@yangyer
yangyer / list-iis-sites-ports-bindings.ps1
Last active December 29, 2017 17:52
Get IIS Sites Binding and Ports
Get-WebBinding | % {
$name = $_.ItemXPath -replace '(?:.*?)name=''([^'']*)(?:.*)', '$1'
New-Object psobject -Property @{
Name = $name
Binding = $_.bindinginformation.Split(":")[-1]
Port = [int]::Parse($_.bindinginformation.Split(":")[1])
}
} |
#Where-Object {$_.Name -like "Site1-*"} |
Sort-Object Port |
@yangyer
yangyer / Start-ExecuteUAC.ps1
Last active January 30, 2016 00:18
Powershell sudo
function Start-ElevatedUACSession {
$outputFiles = @{
Standard = [System.IO.Path]::GetTempFileName();
Error = [System.IO.Path]::GetTempFileName();
}
$cmd = [string]::Join(" ", $args)
Write-Host "Executing Elevated: $cmd"
Start-Process powershell -Verb "runAs" -WindowStyle Hidden -Wait -ArgumentList "/Command ""& { $cmd > '$($outputFiles.Standard)' }"""
Get-Content $outputFiles.Standard
$outputFiles.Values | Remove-Item
@yangyer
yangyer / psScreenScrapExample.ps
Last active January 14, 2016 00:44
Html to XML with PowerShell
function Get-ShowTimes($movie) {
$url = "https://www.bing.com/search?q=$movie movie showings"
$result = Invoke-WebRequest -URI $url
$result.AllElements |
Where ID -eq "tab_2" |
Select -First 1 -ExpandProperty innerText
}
Get-ShowTimes StarWars
Get-ShowTimes "Daddy's Home"
Get-ShowTimes "The Revenant"