Stephen Pham

Full-Stack Developer

Automate IIS Sites with PowerShell

Converting an IIS virtual directory to web application requires a number of steps. If tens or hundreds of sites are involved and done manually, this can be a tedious, error prone and time-consuming endeavor. Luckily, PowerShell can automate those tasks with relative ease :-). Import-Module WebAdministration foreach ($appName in Get-Content .\SitesList.txt) { Write-Host $appName -fore green; # $appName = "MyApp" $appPoolName = "AppPool_$appName" $sitePath = "example.com" $folderPath = "C:\inetpub\example.com\$appName" $iisPath = "IIS:\Sites\example.

Update npm packages

Given the rapid pace of changes, it is a given that we’ll need to update our projects’ npm packages eventually. There are several different techniques we can use to update a NodeJs project: Built-in Utilities We can check for outdated packages by running the command line npm outdated in the project’s root folder. Executing another command line npm update will update the packages according to the semantic versioning (semver) restraints

Steps to update .NET Core app from v2.1 to v2.2

Here are the steps I took to update a recent project: Install the .NET Core 2.2 SDK from https://dotnet.microsoft.com/download/dotnet-core/2.2. The SDK download will also install the runtime. Update the TargetFramework attribute in the project’s .csproj file: <TargetFramework>netcoreapp2.2</TargetFramework> Run the command line dotnet list package --outdated to find which packages might need to be updated. With certain packages, you’re required to update them or the project won’t compiled (ie dotnet build).

Various Webpack Loader Configurations

One confusing aspect of webpack is recognizing the various webpack loader configurations. This is due in part to webpack maintaining backward compatibility with prior versions. Here are five different methods to specify loaders in the configuration file: { test: /\.scss$/, use: ['style-loader','css-loader','sass-loader'] } { test: /\.scss$/, use: [{loader:'style-loader'}, {loader:'css-loader'}, {loader:'sass-loader'}] } { test: /\.scss$/, loaders: ['style-loader','css-loader','sass-loader'] } { test: /\.scss$/, loaders: [ {loader:'style-loader'}, {loader:'css-loader'}, {loader:'sass-loader'}] } { test: /\.scss$/, loader: 'style-loader!