Monthly Archives: September 2016

Azure SDK Installation Issues

If you are trying to install the Azure SDK with the Web Platform Installer and the process gets “stuck” on step two, run the following from an administrative command prompt to remove and recreate the SQL localdb instance: Delete the … Continue reading

Posted in Azure, PowerShell | Leave a comment

PowerShell: Add MIME Type to IIS Static Content Collection

Here’s a PowerShell snippet that will add a custom header to the response from a designated website using the Add-WebConfigurationProperty cmdlet: Import-Module WebAdministration   Add-WebConfigurationProperty //staticContent -name collection -value @{fileExtension=’.woff2′; mimeType=’application/x-font-woff’} The Add-WebConfigurationProperty cmdlet is part of the IIS WebAdministration … Continue reading

Posted in PowerShell | Leave a comment

PowerShell: Add Custom Header to IIS Website Responses

Here’s a PowerShell snippet that will add a custom header to the response from a designated website using the Add-WebConfigurationProperty cmdlet: Import-Module WebAdministration   Add-WebConfigurationProperty //system.webServer/httpProtocol/customHeaders "IIS:\sites\MySuperWebsite" -AtIndex 0 -Name collection -Value @{name=’Access-Control-Allow-Origin’;value=’*’} The Add-WebConfigurationProperty cmdlet is part of the … Continue reading

Posted in PowerShell | 2 Comments

PowerShell: Allow File and Printer Sharing Through Windows Firewall

To allow file and printer sharing, you may need to open the Windows Firewall. Here’s a one line PowerShell script that allows file and printer sharing through the Windows Firewall by enabling the firewall rule group: Enable-NetFirewallRule -Group "@FirewallAPI.dll,-28502" -Direction … Continue reading

Posted in PowerShell, Windows Server 2012 | Leave a comment

Microsoft SQL Server 2014: Change Default Data, Log, and Backup Directories via T-SQL or PowerShell

If you need to change the default data, log, and/or backup directories on a SQL 2014 MS SQL Server default instance after installation, you can use these three SQL commands: EXEC xp_instance_regwrite N’HKEY_LOCAL_MACHINE’ , N’Software\Microsoft\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQLServer’ , N’DefaultData’ , … Continue reading

Posted in MS SQL Server, PowerShell, T-SQL | Leave a comment

Azure: Troubleshooting PowerShell DSC Resources

The errors you get back from the PowerShell DSC extension in Azure can be frustratingly terse. Here’s a way to troubleshoot and try out PowerShell DSC changes without having to deploy the extension over and over again. After the extension … Continue reading

Posted in Azure, PowerShell, PowerShell DSC | Leave a comment