#Ladda ner
git clone git://git.drogon.net/wiringPi
#Kompilera
cd wiringPi
./build
using System; | |
using System.Collections.Generic; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.Caching; | |
using System.Web.Mvc; | |
using Microsoft.AspNet.Identity; | |
using FileDownloadSecurityIdeas.Models; |
$(Invoke-RestMethod -Uri http://channel9.msdn.com/Shows/Windows-Azure-Friday/feed/mp4high)|%{$pattern = "[{0}]" -f ([Regex]::Escape( [System.IO.Path]::GetInvalidFileNameChars() -join '' )); @{ FileName = [RegEx]::Replace($_.title + ".mp4", $pattern, ''); Url=@($_.group.content.url |sls high.mp4)[0].ToString()} }|%{if(!(Test-Path -Path $_.FileName )){Invoke-WebRequest -Uri $_.Url -OutFile $_.FileName}} |
#Ladda ner
git clone git://git.drogon.net/wiringPi
#Kompilera
cd wiringPi
./build
gci -Directory -Recurse .git -Hidden|%{pushd;cd (Split-Path -Parent $_);(git remote -v)-split "`n"|%{$r=$_ -split "`t| ";iex "git remote set-url $(if($r[2]-eq"(push)"){"--push "})$($r[0]) $($r[1]-replace ("John","Doe"))"} ;popd} |
$owner = "repo owner" | |
$body = @{type="POST";URL="slack hook"} | |
$cred=Get-Credential | |
$repos = Invoke-RestMethod -Credential $cred -Uri 'https://api.bitbucket.org/1.0/user/repositories/' | |
#All repos | |
$repos |Where-Object {$_.owner -eq $owner} | %{$uri="https://bitbucket.org/api$($_.resource_uri)/services/";Invoke-RestMethod -Uri $uri -Body $body -Method Post -Credential $cred} | |
#Filter repos | |
$repos |Where-Object {$_.owner -eq $owner -and $_.resource_uri -like "*needle*" } | %{$uri="https://bitbucket.org/api$($_.resource_uri)/services/";Invoke-RestMethod -Uri $uri -Body $body -Method Post -Credential $cred} |
$postSlackMessage = @{token="*topsecret*";channel="#general";text="Hello from PowerShell!";username="PowerShell";icon_url="https://pbs.twimg.com/profile_images/1604347359/logo_512x512_normal.png"} | |
Invoke-RestMethod -Uri https://slack.com/api/chat.postMessage -Body $postSlackMessage |
Param( | |
[string]$SubscriptionName = ((Get-AzureSubscription|?{$_.SubscriptionName -like "*MSDN*"})[0].SubscriptionName), | |
[string]$AzureVMImageName = "03f55de797f546a1b29d1b8d66be687a__Visual-Studio-2013-Ultimate-Update4-AzureSDK-2.5-Win8.1-x64" | |
) | |
function InstallWinRMCert($serviceName, $vmname) | |
{ | |
$winRMCert = (Get-AzureVM -ServiceName $serviceName -Name $vmname | select -ExpandProperty vm).DefaultWinRMCertificateThumbprint | |
$AzureX509cert = Get-AzureCertificate -ServiceName $serviceName -Thumbprint $winRMCert -ThumbprintAlgorithm sha1 | |
DROP TABLE dbo.Events | |
DROP TABLE dbo.Streams | |
CREATE TABLE dbo.Streams( | |
StreamId CHAR(40) NOT NULL, | |
StreamIdOriginal NVARCHAR(1000) NOT NULL, | |
StreamIdInternal INT IDENTITY(1,1) NOT NULL, | |
IsDeleted BIT NOT NULL DEFAULT ((0)), | |
CONSTRAINT PK_Streams PRIMARY KEY CLUSTERED (StreamIdInternal) | |
); |
Param( | |
[ValidateScript( | |
{ | |
$countries = ((Invoke-RestMethod -Uri https://raw.githubusercontent.com/devlead/ISO-3166-Countries-with-Regional-Codes/master/all/all.json)| % Name) | |
if ( $countries -contains $_) | |
{ | |
$true | |
} | |
else | |
{ |