Windows PowerShell Script (Testing)

Now the script is available at

So, I have reviewed the whole script and done some workarounds for some bugs and issues there exists in pwsh scripts. I had created a script that worked Windows 10 Pro, but we found some issues in Home and Windows Server 2016.

The last commit I have tested against The latest Windows 10 Pro and latest Windows Server build. All working.

If anyone wanna test in Windows Containers you have to use this dockerfile

# escape=`
USER ContainerAdministrator

ENTRYPOINT [ "pwsh.exe" ]

All Windows images have issues with the administrator user (BTW, the environment variables are “frozen” in any windows image - you gonna be able to edit it, but it won’t be permanent). So, you have to force it. I have tested with, but don’t try. These images, and several others a HUGE (7GB+++). Microsoft is really bad with Docker images. Only nanoserver image is good, but it has several bugs. If you insist, it will work just fine.

I still have to test the @joaquin’s test example - As I was working to solve the testing on docker and other bugs, I didn’t have time to test with it. But I will.

BTW, Powershell has Linux images. They won’t work with this script. The Linux images are good for other purposes.

Tests that can be performed with the Script

1 - Normal installation.

A. Deny the first prompt to accept the license.
B. Accept and install normally.

iwr -useb | iex

2 - Install with the variable accepting the license,

$ acceptLicense = "yes"; iwr -useb | iex

3 - Install an older version using the Version variable
NOTE. If the user already has a Dgraph installation, the only way to overwrite it is by using the Version variable. I did this to avoid accidental upgrades.

$ Version = "v20.03.1"; iwr -useb | iex

4 - Install an older version and accept the license at the same time.

$ Version = "v20.03.1"; $ acceptLicense = "yes"; iwr -useb | iex

There are also flags.

Flags are tricky in Windows Powershell. The user must download the script to make it work. There’s no way to run (as fas as I know) flags on remote Scripts.


iwr -useb -outf install.ps1; \
.\install.ps1 -version v20.03.1 -acceptLicense y

Example in real life:

# Install Latest
> iwr -useb | iex

# Install a predefined version via variable.
> $Version="v20.03.1"; iwr -useb | iex

# Install a predefined version and accept license via variable.
> $Version="v20.03.1"; $acceptLicense="yes" ; iwr -useb | iex

# Install a predefined version adn accept the license via flag args.
> iwr -useb -outf install.ps1; .\install.ps1 -version v20.03.1 -acceptLicense y

You can run Windows Container on Linux? Or only Windows w/ Hyper-V?

Microsoft has free images for use with HashiCorp Vagrant. I am guessing it only runs with virtualbox (despite vagrant supporting hyper-v, kvm, vmware, etc). Docs for this are non-existent or well hidden currently:

Only windows

note above.

Tests with VMs are fine.

So Win10 Home w/ Docker-Machine + Virtualbox?

Docker on Windows works on Hyper-V and Windows Containers. There’s no way to run Windows Containers in Virtualbox docker machines. Because they are tied to Windows itself.

On docker settings you have to Switch to Windows containers to use “Windows containers”.

1 Like

Now the script is available at