Skip to main content

Posts

How to install Assembly Binding Log Viewer (fuslogvw.exe) from Windows 10 SDK

The Assembly Binding Log Viewer(fuslogvw.exe) displays details for assembly binds. This information helps you diagnose why the .NET Framework cannot locate an assembly at run time. These failures are usually the result of an assembly deployed to the wrong location, a native image that is no longer valid, or a mismatch in version numbers or cultures.  If you don't have Visual Studio installed and you wanted to run it (fuslogvw.exe), do: Download Windows 10 SDK installer .  Install Windows 10 SDK and ensure Open fuslogvw.exe in C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools

Creating and logging in to a Windows Containers user with a password

Windows Containers by default uses ContainerAdministator user account with blank password. Creating a new user with password can be done but cannot be used in DockerFile for example. If you want to use another user in a container you have to create a user with blank password! To login to a container with a password, do the following: PS C:\> $cert = New-SelfSignedCertificate -DnsName "dontcare" -CertStoreLocation Cert:\LocalMachine\My PS C:\> winrm create winrm/config/Listener?Address=*+Transport=HTTPS ('@{Hostname="notimportant"; CertificateThumbprint="' + $cert.Thumbprint + '"}') PS C:\> winrm set winrm/config/service/Auth '@{Basic="true"}' PS C:\> $cred = New-Object pscredential 'timus', (ConvertTo-SecureString -String 'P@$$w0rd' -AsPlainText -Force) PS C:\> Enter-PSSession -Credential $cred -ComputerName localhost -Authentication Basic -UseSSL -SessionOption (New-PSSessionOption -Skip

Remove blank lines using Notepad++

Say you have a document as shown below. And you want to remove the blank lines - represented by {CR}{LF}. To do this using Notepad++, bring up Replace dialog ( Search | Replace...  or CTRL+H ) and use ^\r\n in Find What  and blank for Replace . In Search Mode, change it to Regular Expression . See below for an example. What it does it use regular expression to search for carriage return and linefeed characters and match only if it is the beginning of the line (^). And of course replace it with a blank character.

Split a line into multiple lines using Notepad++

Say you have a document like below. And you want to split "hello world" into multiple lines. Doing this using Notepad++ is easy. Bring up Replace dialog ( Search | Replace... or CTRL+H ), in  Find what use hello world\r\n . This matches the entire line including carriage return and linefeed character. In Replace with replace the string with the intended multi-line data, for example, hello\r\n\world\r\n , will replace the line into two. One is hello , followed by world in the next line. And of course, for this to work you need to select Regular expression in the Search Mode .

How to delete Windows protected partition

How to delete Windows protected partition Run diskpart in elevated command prompt, like: c:\> diskpart Then follow the prompts like below: Microsoft DiskPart version 10.0.18362.1171 Copyright (C) Microsoft Corporation. On computer: M1 DISKPART> list disk Disk ### Status Size Free Dyn Gpt -------- ------------- ------- ------- --- --- Disk 0 Online 180 GB 53 GB * DISKPART> select disk 0 Disk 0 is now the selected disk. DISKPART> list partition Partition ### Type Size Offset ------------- ---------------- ------- ------- Partition 1 System 100 MB 1024 KB Partition 2 Reserved 16 MB 101 MB Partition 3 Primary 126 GB 117 MB Partition 4 Recovery 499 MB 126 GB DISKPART> select partition 4 DISKPART> delete partition override DISKPART> exit Leaving DiskPart...

Windows containers cannot use USER instruction to change user with a password

 I have a Dockerfile like below: FROM mcr.microsoft.com/windows/servercore:20H2 as final RUN net user timus P@$$w0rd123!@# /add /Passwordchg:No RUN WMIC USERACCOUNT WHERE "Name='timus'" SET PasswordExpires=FALSE RUN net localgroup administrators timus /add USER timus RUN whoami Running this will fail with an error message like below: C:\mydocker>docker build -t myimages:1.0.0 -f Dockerfile Sending build context to Docker daemon 678.8MB Step 1/6 : FROM mcr.microsoft.com/windows/servercore:20H2 as final ---> 4943ff812624 Step 2/6 : RUN net user timus P@$$w0rd!@# /add /Passwordchg:No ---> Running in 95d4d70138d8 The command completed successfully. Removing intermediate container 95d4d70138d8 ---> d00130167ea2 Step 3/6 : RUN WMIC USERACCOUNT WHERE "Name='timus'" SET PasswordExpires=FALSE ---> Running in 0d05945d8f70 Updating property(s) of '\\0D05945D8F70\ROOT\CIMV2:Win32_UserAccount.Domain="0D05945D8F70",Name=&q