Category: powershell

Fun with Moniker- naming assembly versions

I liked the way docker generates names for every container instance – it was a funny way to differentiate them. I was thinking  – what about nuget packages – or any other release  ?

I have discovered Moniker – . Can be used as in docker – to generate different names at various runs. However, what I wanted is to make every release to have a funny name.

I have put in .NET Core local tools ( see  and the blog post ) and I have used from powershell ( see for the usage)

First, I have created a variable

if($result -eq 0){

$moniker = “$(dotnet moniker -s moby)-$dateToPrint”



$moniker = “$(dotnet moniker -s moniker)-$dateToPrint”


then used this variable in the release notes

$releaseNotes += (“;BuildNumber $env:BUILD_BUILDNUMBER with name “+ $moniker)

and in assembly title

dotnet-property “**/*.csproj” AssemblyTitle:”NetCoreBlockly $moniker”

Then, in C# , I write in the console:

static string nameBlockly()


var ass = Assembly.GetExecutingAssembly();

var assName = ass.GetName();

var nameBlockly = assName.Name;



var title = ass.GetCustomAttribute<AssemblyTitleAttribute>();

nameBlockly = title?.Title ?? nameBlockly;




//do nothing


return $”{nameBlockly} version:{assName.Version.ToString()}”;


If you want to see in action , you can:

  1. Look at the nuget release notes at ( see BuildNumber … with name
  2. See the change log – every release has the name
  3. Install NetCoreBlockly  and see the name 

See the tests in VSCode and improvements in powershell–part 24

I wanted that the user can see the tests when running in  VSCode. So in devcontainer.json I have put

“extensions”: [

and in the settings.json on .vscode folder


dotnet-test-explorer.enableTelemetry”: false,


So far, so good. But – I remember that powershell have a problem. And I figure why – before running

dotnet pwsh

I should run

dotnet tool restore

in order to run the dotnet-toolsjson from .config file



“version”: 1,

“isRoot”: true,

“tools”: {

“powershell”: {

“version”: “6.2.3”,

“commands”: [







.And this command should be executed both in Docker and in Azure


And one hour passes...
(This is the result of 1 hour per day auto-challenge as a full cycle developer for an exchange rates application)
( You can see the sources at )
2Reading NBR from internet
3Source control and build
4Badge and test
5CI and action
6Artifacts and dotnet try
7Docker with .NET Try
9Intermezzo - Various implementations for programmers
10Intermezzo - similar code - options
11Plugin implementation
12GUI for console
14Plugin in .NET Core 3
15Build and Versioning
16Add swagger
17Docker - first part
18Docker - second part
19Docker - build Azure
20Pipeline send to Docker Hub
21Play with Docker - online
22Run VSCode and Docker
23Deploy Azure
24VSCode see tests and powershell
25Code Coverage
26Database in Azure
27Sql In Memory or Azure
28Azure ConString, RSS
29Middleware for backward compatibility
30Identical Tables in EFCore
31Multiple Data in EFCore
32Dot net try again
33Start Azure Function
34Azure function - deploy
35Solving my problems
36IAsyncEnumerable transformed to IEnumerable and making Azure Functions works
37Azure functions - final
38Review of 37 hours
39Last Commit in AzureDevOps
40Create Angular WebSite
41Add static Angular to WebAPI .NET Core
42Docker for Angular
43Angular and CORS
44SSL , VSCode, Docker
45Routing in Angular
46RxJS for Routing
47RxJs Unsubscribe

Powershell vs console application

I have decided to make the utilities that I use in form of Powershell applications instead of Windows / Console applications


There are simpler to use  – just run the powershell

The parsing of command line is powerfull in powershell

There are simpler to maintain ( just text scripts files)

There are no big dependencies( .NET Core/ .NET 4.x  to be installed)

This is a good tool under  my toolbelt

Everything you do in .NET you can do in Powershell ( sometimes it is much harder in .NET rather then powershell)


The repository is and the first item is to move the big files from C: into another drive to free space by making a junction dir ( e.g. C:\ProgramData\Package Cache and C:\Windows\Installer )



I have become tired of reading about how to enable Wifi HotSpot in Windows 10 . The reference is here: . ( also, for bandwidth throttling you can try and / or   )

I was trying to make a Windows Store application – but, apparently, it is very difficult to run command lines application from Windows Store/

So I made a small powershell file ( hosted at )


Powershell and always use explicit


Let’s suppose you have a variable $x=”

In powershell the following are the same


Write-Host $x


I want to make a function that returns a value . Let’s say

Function Add([string] $a, [string]$b)


#debug to see arguments



return $a + $b



If I call this function with

Add 10 17 # the syntax for calling powershell is WITHOUT comma – the comma indicates arry

it shows




However , if I wrote

$x = Add 10 17

it does not wrote




Do you know why ?


Answer in the first comment

powershell and clean iis

Sometimes it is necessary to remove IIS temp files from windows directory

So I have made this following script in powershell

iis reset

What it does:
restarts iis ( run as admin in Windows 7)

Cleans temporary folders from

$windir + “\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files”

$windir + “\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”

Enjoy !(iis reset)

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.