# Http Server
$http = [System.Net.HttpListener]::new()
# Hostname and port to listen on
$http.Prefixes.Add("http://localhost:8080/")
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
# Load file | |
$Content = import-csv 'responses.csv' -Header time,VotreNiveau,HeureParfaite,NiveauDesPresentations,Sujet | | |
select -Skip 1 | | |
select -prop VotreNiveau,HeureParfaite,NiveauDesPresentations,Sujet | |
# Create some arrays | |
$allHeureParfaitevalues=@() | |
$allSujetvalues=@() | |
# Retrieve properties (questions) and foreach... |
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://communary.net/2015/01/12/quick-tip-determine-if-input-comes-from-the-pipeline-or-not/ | |
function Invoke-Test { | |
[CmdletBinding()] | |
param ( | |
[Parameter(ValueFromPipeline)] | |
[PSObject[]] $InputObject, | |
[Parameter()] | |
[string] $SecondParam | |
) |
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
$MeetupSecretKey = '<My API Key>' | |
# POST | |
Invoke-RestMethod -Uri "https://api.meetup.com/2/events?key=$script:MeetupSecretKey&sign=true&group_urlname=FrenchPSUG&name=testevent" -Method post | |
#Invoke-RestMethod : The remote server returned an error: (405) Method Not Allowed. | |
# Using a Session | |
Invoke-RestMethod -Uri "https://api.meetup.com/2/events?key=$script:MeetupSecretKey&sign=true&group_urlname=FrenchPSUG&name=testevent" -SessionVariable aa | |
#Works | |
# Signed_url is available in $aa.meta.signed_url | |
Invoke-RestMethod -Uri "https://api.meetup.com/2/events?key=$script:MeetupSecretKey&sign=true&group_urlname=FrenchPSUG&name=testevent" -Method post -WebSession $aa |
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-DomainComputer { | |
[CmdletBinding()] | |
PARAM( | |
[Parameter(ValueFromPipelineByPropertyName=$true, | |
ValueFromPipeline=$true)] | |
[Alias("Computer")] | |
[String[]]$ComputerName, | |
[Alias("ResultLimit","Limit")] | |
[int]$SizeLimit='100', |
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-HTMLTable | |
{ | |
param ( | |
[Parameter(Mandatory = $true)] | |
[Microsoft.PowerShell.Commands.HtmlWebResponseObject]$WebRequest, | |
[Parameter(Mandatory = $true)] | |
[int]$TableNumber | |
) | |
CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control
and E-Tag
headers, etc.), minification, etc.
- Make sure you have registered a domain name.
- Sign up for CloudFlare and create an account for your domain.
- In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
- From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
- If you
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
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
irm http://ipinfo.io | |
<# | |
ip : 100.111.122.33 | |
hostname : Something.ebox.ca | |
city : Montreal | |
region : Quebec | |
country : CA | |
loc : 49.4667,-70.4667 | |
org : AS1000 EBOX |
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 A | |
{ | |
[CmdletBinding()] | |
Param | |
( | |
[parameter(ValueFromPipeline=$true)] | |
$MyParam | |
) | |
Begin |