Tag Archives: powershell

How to deploy Service Fabric application using ARM template and PowerShell, part 2: ARM

This is a series of blog posts: Part 1: PowerShell Part 2: ARM To publish an ARM template using whichever mechanism you’d like, first you need the actual ARM template. Here’s an example of an application consisting of one stateless … Continue reading

Posted in Programming | Tagged , , | Leave a comment

How to package Service Fabric application into SFPKG in .NET Core using MSBuild task

This task wouldn’t require much efforts but: Service Fabric doesn’t support packaging its “package” (which is not a real package but just a directory) into .sfpkg out-of-the-box. Only suggests to use ZipFile.CreateFromDirectory. MSBuildTasks doesn’t support .NET Core so we can’t … Continue reading

Posted in Programming | Tagged , , | Leave a comment

How to deploy Service Fabric application using ARM template and PowerShell, part 1: PowerShell

This is a series of blog posts: Part 1: PowerShell Part 2: ARM Prerequisites: You have your cluster up and running. How to achieve that is outside of the scope of this series Cluster has all necessary certificates deployedddeplo as … Continue reading

Posted in Programming | Tagged , , | Leave a comment

How to remove ARM resources for Service Fabric application and service using PowerShell

First you need to remove the resource corresponding to the application itself: And then the resource corresponding to the service:

Posted in Programming | Tagged , , | Leave a comment

How to call LINQ extension methods such as Where and ToDictionary using PowerShell

If you have IEnumerable<XElement> and want to call various LINQ extension methods such as Enumerable.Where() or ​​Enumerable.ToDictionary() on it using PowerShell then first load the necessary assemblies: And here’s the code for Where(): and for ToDctionary():

Posted in Programming | Tagged , | Leave a comment

The BuildLayout of the application is invalid. Code is missing for service

If you’re getting these very rare but still mysterious errors: Started executing script ‘Deploy-FabricApplication.ps1’. Test-ServiceFabricApplicationPackage : The BuildLayout of the application in c:\Temp\TestApplicationPackage_3811564851592\icw0q1rk.bus\Release is invalid. Code is missing for service MyWebApiPkg. or Register-ServiceFabricApplicationType : The BuildLayout of the application in … Continue reading

Posted in Programming | Tagged , | Leave a comment

How to deploy Azure Data Factory pipeline and its dependencies programatically using PowerShell

Since ADF unfortunately doesn’t provide a built-in way for automated deployment, to do this you have to write a custom script. Then you can run it on build server such as VSTS or TeamCity. If you’re in the interactive mode, … Continue reading

Posted in Programming | Tagged , | 44 Comments

How to install PowerShell using PowerShell

This cmdlet is tricky to find in Google because searching for install powershell using powershell won’t give you much. So here it is: Install-WindowsFeature PowerShell or Install-WindowsFeature PowerShell-V2 P.S. How to find exact name of particual Windows Feature to install? … Continue reading

Posted in Infrastructure | Tagged | Leave a comment

How to start using recently uploaded Azure disk

After you uploaded a vhd and before you can start really using it you must mark it as a data disk or as an OS disk using the following command: Add-AzureDisk -DiskName ‘myvhd.vhd’ -MediaLocation http://example.blob.core.windows.net/container/myvhd.vhd -OS Windows

Posted in Infrastructure | Tagged , | Leave a comment

How to re-create symlinks of VM configs in Hyper-V using PowerShell

Hyper-V keeps VM configs at %ProgramData%\Microsoft\Windows\Hyper-V\Virtual Machines\ as symlinks to the original location. You may get them broken due to various reasons, e.g.: Server disaster and then recovery Upgrade to the next version of OS/Hyper-V and then rollback Migration of … Continue reading

Posted in Infrastructure | Tagged , | Leave a comment