Tag Archives: powershell

HOWTO switch off Defender in Windows Sandbox

Recently I tried to run a setup program into the Windows Sandbox, but Windows Defender blocked it. About 60 seconds later, I discovered that I cannot disable/configure it from the usual UI. After some investigation, I discovered that we can do it by a couple of commands in PowerShell with administrative access rights: Set-ItemProperty -Path “HKLM:\SYSTEM\CurrentControlSet\Control\CI\Policy” -Name “VerifiedAndReputablePolicyState” -Value “0” CiTool.exe -r After applying these … Continue reading HOWTO switch off Defender in Windows Sandbox »

HOWTO install ‘winget’ from command line

Sometimes we might need to use the amazing ‘winget’ command where it isn’t available (for example from a Windows Sandbox, …). The few steps below will solve this problem. The installation process To install ‘winget’ command, you will need to download C++ Runtime framework packages for Desktop Bridge from MS, selecting the proper package (x86, x64, …) from the ‘How to install and update Desktop … Continue reading HOWTO install ‘winget’ from command line »

HOWTO enable Powershell script execution

updated: 09/10/2021   Powershell is indeed a very powerful tool, and sometimes we may need to commit several similar operations that we can quickly organize in a script.  By default, you cannot execute any unsigned PowerShell script.  This can be a problem if we don’t know how, or you need to do a quick maintenance task. We can update this setting, by opening a Powershell … Continue reading HOWTO enable Powershell script execution »

HOWTO compact vhd/vhdx Hyper-V files

It happened that the usual compact disk from Hyper-V Console doesn’t seem to be effective on one of my .vhdx file. Looking around on the web, I discovered that it is a quite common problem. The solution is to open a Powershell window with administrative access rights, and use the following command: optimize-vhd <offline Hyper-V disk file> -mode full For further details about this command, … Continue reading HOWTO compact vhd/vhdx Hyper-V files »