Skip to content

Instantly share code, notes, and snippets.

@sqlchow
sqlchow / Get-StorageAccountEncryptionStatus.ps1
Last active Apr 4, 2017
Check if SSE is enabled for blob storage in a storage account.
View Get-StorageAccountEncryptionStatus.ps1
Get-AzureRmStorageAccount | Select-Object ResourceGroupName, StorageAccountName, @{n="isEncrypted"; e={"$($_.Enc
ryption.Services.Blob.Enabled)"}}
View AzureAlertEmail.psm1
function Update-PAzureAlertEmail
{
<#
.SYNOPSIS
This function either adds or removes an email from Alerts in azure
.DESCRIPTION
This function will remove the enclosed email from all the alerts in an azure subscription.
If ADD is specified it will add the email to the all the alerts in an azure subscription.
When this function is called it will return an object of the items that were added or removed.
.EXAMPLE
View overheadtest_alittletuned.ps1
$iterations = 10000
$saveFile = 'C:\Users\heman\Desktop\OverheadTests\results.txt'
$m1Description = 'Refence: Only doing calculations'
Write-Host 'Starting Measurement 1'
$m1 = Measure-Command {
1..100 | ForEach-Object {
$_ + ($_ * $_)
}
}
View Get-TwelveDaysOfChristmas.ps1
$list = @"
1 Partridge in a pear tree
2 Turtle Doves
3 French Hens
4 Calling Birds
5 Golden Rings
6 Geese a laying
7 Swans a swimming
8 Maids a milking
9 Ladies dancing
@sqlchow
sqlchow / Get-AzureVMPowerState.ps1
Created Nov 17, 2015
Quickly get Azure ARM VM PowerState
View Get-AzureVMPowerState.ps1
#To use with the newer Azure PowerShell use Get-AzureRmVM instead of Get-AzureVM
Get-AzureVM -Name 'AzureRmVM01' -ResourceGroupName 'arm-rg' -Status | `
Select-Object -ExpandProperty Statuses | Where-Object {$_.Code -like '*PowerState*'} | `
Select-Object @{l='PowerState';e={$_.Code.Split('/')[1]}}
View Remove-SomeWin10Apps.ps1
<#
.LINK
https://thomas.vanhoutte.be/miniblog/delete-windows-10-apps/
#>
Get-AppxPackage *3d* | Remove-AppxPackage
Get-AppxPackage *camera* | Remove-AppxPackage
Get-AppxPackage *bing* | Remove-AppxPackage
Get-AppxPackage *zune* | Remove-AppxPackage
Get-AppxPackage *people* | Remove-AppxPackage
Get-AppxPackage *phone* | Remove-AppxPackage
@sqlchow
sqlchow / wl-provisionvm.ps1
Last active Nov 17, 2015
Azure Automation Workbook for automation using WunderList Tasks
View wl-provisionvm.ps1
workflow wl-provisionvm
{
sequence
{
#Step1: Setup credentials for Azure Automation
#001. Subscription name and credential
$SubscriptionName = "subscriptionname"
$PSCreds = Get-AutomationPSCredential -Name 'wunderlist-deploy'
#002. Add Azure Account
@sqlchow
sqlchow / AzureAutomationWithWunderlistTasks.ps1
Last active Nov 17, 2015
Sample test reading wunderlist tasks from azure automation runbooks
View AzureAutomationWithWunderlistTasks.ps1
workflow wl-provisionvm
{
sequence
{
#Step1: Setup credentials for Azure Automation
#001. Subscription name and credential
$SubscriptionName = "subscriptionname"
$PSCreds = Get-AutomationPSCredential -Name 'wunderlist-deploy'
#002. Add Azure Account
View Get-YoutubeSearchResults.ps1
function Get-YoutubeSearchResults{
param(
[string]
$Query
)
begin{
$ApiKey = 'addyourAPIkey here'
$requestUri = "https://www.googleapis.com/youtube/v3/search?part=id%2C+snippet&q=$Query&key=$ApiKey"
$watchUrl = "https://www.youtube.com/watch?v="
@sqlchow
sqlchow / R-NeuralNetworks
Last active Dec 9, 2015
Some links to creating neural networks using R
View R-NeuralNetworks
http://gekkoquant.com/2012/05/26/neural-networks-with-r-simple-example/
https://beckmw.wordpress.com/tag/neural-network/
http://www.r-bloggers.com/r-code-example-for-neural-networks/
http://journal.r-project.org/archive/2010-1/RJournal_2010-1_Guenther+Fritsch.pdf
http://www.louisaslett.com/Courses/Data_Mining/ST4003-Lab5-Introduction_to_Neural_Networks.pdf
http://stats.stackexchange.com/questions/81261/r-neural-network-model-with-target-vector-as-output-containing-survival-predicti
http://stats.stackexchange.com/questions/65292/r-neuralnet-compute-give-a-constant-answer