Posts about PowerShell
While watching a video on coding environment and workflow I learned about zoxide, a smarter cd command. I checked it out in more detail and was pleasantly surprised that it's also available for PowerShell on Windows. Of course, I had to try it out, and after a short period of testing I decided to make it a permanent part of my PowerShell configuration, along with several other PowerShell modules I'm already using.
GitHub Copilot for CLI is an NPM package which you can install and use on Windows if you have Node.js 16 or newer on your machine. However, the official setup only makes the commands available in zsh and bash. This means that you can only use it in WSL, but fortunately, there are also ways to make it work in PowerShell.
I have been working on older Ionic Angular projects lately that can not be built with the latest version of Node.js. At first, it seemed like downgrading npm would suffice. When I realized that I would also need to downgrade my Node.js installation, I decided to bite the bullet and install NVM for Windows.
Inspired by Scott Hanselman's blog post and a discussion with my colleagues, I further improved my PowerShell configuration by installing a few select PowerShell modules.
I like doing things from the command line and use PowerShell daily. I miss some features in the default Windows PowerShell console and use Windows Terminal and Oh my Posh to improve the experience. After just completing the configuration on a freshly installed machine, I decided to write down what I did so that I can repeat the process next time.
To make blobs in Azure storage publicly accessible, in addition to the account level setting each container also must have its access level set accordingly. My approach to copying content between accounts didn't preserve this property. This meant I had to find a way to set it efficiently for all containers in the account.
There's no functionality in Azure Portal to migrate contents of an Azure Storage account to another one. But there is a command-line tool that can do it - AzCopy. Recursively copying all blobs between two storage accounts is one among the many operations it supports.
When exposing your TeamCity build server to the internet, you'll want to use HTTPS so that users won't have to send their passwords over an unencrypted connection. Thanks to Let's Encrypt, you can now get the SSL certificate for free, but there is still some work involved to get everything configured correctly.
Newly created classic virtual machines in Azure have dynamic public IP addresses. Although, Resource Manager is now the recommended deployment model, there are still image templates in the marketplace that requires classic deployment model. If you don't want the IP addresses of these virtual machines to change when they are stopped, you will need to reserve the IP. At the moment this can only be done using Azure PowerShell.
I recently broke my streak of 3 Windows 10 upgrades without any issues whatsoever, when I needed to upgrade my new Lenovo laptop. I downloaded MediaCreationTool to create a bootable USB stick for a clean Windows 10 installation. After the download got stuck at around 30 %, I killed the MediaCreationTool process. When I tried to start it again, it failed with the following error: Setup couldn't start properly. Please reboot your PC and try running Windows 10 Setup again.
When I moved my blog to Azure, I broke the AWStats statistics, which I had configured, when I was still hosting the blog myself. Almost a month after the move it was about time to get it working again.
Windows Store apps store their settings in a registry hive file named settings.dat. Even after loading it into registry the values inside it are non-standard which makes them difficult to read and edit. The post dives into their serialization format and guides the reader through developing a PowerShell function for editing the values.
Git's default installation only makes it available from com command line in its embedded terminal. As a regular user of ConEmu and PowerShell, I wanted to make it work in my system command prompt with tab completion and credential caching.
Hooks in Subversion can be used to execute custom logic before or after certain actions in repository: commit, lock, unlock and revision property change. They are defined by specifying a batch script that gets executed at that point. In my particular case I wanted to use a PowerShell script before commit to prevent certain files being committed to the repository.
Microsoft Exchange supports Send As and Send On Behalf Of permissions to be granted to users for individual e-mail addresses. Sending e-mail from Outlook for these users is very simple. If you want to achieve this from code there is a little more work involved.