if (!(Get-Command python -ErrorAction SilentlyContinue)) {

    Write-Host "Python is required to be installed in order to run it"
    $response = Read-Host "Do you want to install Python? (y/n)"

    if ($response -eq "y") {

        Write-Host "Starting a Python installation..."
        $pythonInstaller = "$env:TEMP\python-installer.exe"
        Invoke-WebRequest -Uri "https://www.python.org/ftp/python/3.10.4/python-3.10.4-amd64.exe" -OutFile $pythonInstaller
        Start-Process -FilePath $pythonInstaller -ArgumentList "/quiet InstallAllUsers=1 PrependPath=1" -Wait
        Remove-Item $pythonInstaller
        Write-Host "Python has been successfully installed"
    } else {
        Write-Host "Python installation is canceled by the user. The script doesn't work without it =("
        exit
    }
}
