Skip to content

Instantly share code, notes, and snippets.

@sqlchow
sqlchow / Get-StorageAccountEncryptionStatus.ps1
Last active April 4, 2017 07:57
Check if SSE is enabled for blob storage in a storage account.
Get-AzureRmStorageAccount | Select-Object ResourceGroupName, StorageAccountName, @{n="isEncrypted"; e={"$($_.Enc
ryption.Services.Blob.Enabled)"}}
@sqlchow
sqlchow / AzureAlertEmail.psm1
Created December 2, 2016 18:19 — forked from crshnbrn66/AzureAlertEmail.psm1
added more functions
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
$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 {
$_ + ($_ * $_)
}
}
$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 November 17, 2015 15:19
Quickly get Azure ARM VM PowerState
#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]}}
<#
.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 November 17, 2015 15:12
Azure Automation Workbook for automation using WunderList Tasks
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 November 17, 2015 15:05
Sample test reading wunderlist tasks from azure automation runbooks
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
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 December 9, 2015 09:12
Some links to creating neural networks using R
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