Skip to main content
Version: 7.0

Windows Server (PowerShell module)

Updating PowerShell module

Open PowerShell as "Administrator":

Using the Start context menu
  1. Right-click on the Start icon in the lower-left corner of the screen.
  2. Select "Windows PowerShell (Administrator)" from the context menu.
Using the Start menu
  1. Left-click on the Start icon in the lower-left corner of the screen.
  2. Type powershell
  3. Open PowerShell as "Administrator" by pressing Ctrl + Shift + Enter

Download the PassworkModule.zip archive to the current directory:

if (-not (Test-Path "$pwd\PassworkModule.zip")) {
(New-Object System.Net.WebClient).DownloadFile(
"https://repos.passwork.pro/repository/powershell/PassworkModule.zip",
"$pwd\PassworkModule.zip"
)
Write-Host "Module successfully downloaded" -ForegroundColor Green
} else {
Write-Host "Module archive already exists" -ForegroundColor Red
}
info

In case of errors, the archive can be downloaded manually: https://repos.passwork.pro/repository/windows_powershell/PassworkModule.zip

Extract the PowerShell module with file replacement:

# Get the location of PowerShell modules 
$windowsModulePaths = $env:PSModulePath -split ";" | Where-Object { $_ -like "C:\Windows*" }

# Extract the PowerShell module to the directory with overwrite
Expand-Archive `
-Path "$pwd\PassworkModule.zip" `
-DestinationPath $windowsModulePaths -Force

# Remove the PassworkModule.zip archive
Remove-Item "$pwd\PassworkModule.zip"

Deactivate and activate the PowerShell module to apply changes in the new version:

# Deactivate the PowerShell module
Remove-Module -Name "PassworkModule"

# Activate the PowerShell module
Import-Module -Name "PassworkModule"
If Passwork is located in a closed network

If the server with Passwork is located in a closed network and has no internet access, you need to:

  1. Download PHP8.3 archive and transfer it to the Windows Server;
  2. Download version 7 archive from the Passwork Customer Portal and transfer it to the Windows Server.

The archives must be located in the directory from which the function to update PHP and Passwork will be executed:

$PWD\php_latest.zip
$PWD\Passwork-xxxxxx.zip

Updating PHP and Passwork

Run the function in PowerShell:

Update-Passwork-Environment
Actions performed
  1. Checking Passwork version
  2. Checking migration execution in the web interface
  3. Checking availability of the client portal
  4. Downloading archives or waiting for archives in $PWD
  5. Extracting PHP
  6. Removing old PHP versions from PATH
  7. Adding the new PHP version to PATH
  8. Creating a Passwork archive (6.5.x)
  9. Extracting the current version of Passwork
  10. Creating files with data filled from config.ini
  11. Registering PHP8.3 in the IIS web server
  12. Updating data in .passwork_component

Function execution process

The function checks the execution of the initial migration in the Passwork web interface (6.5). It unpacks the current versions of Passwork and PHP, then creates configuration files. In case of errors, they are displayed in the PowerShell console:

Example of error output

Upon completion, a message about the successful update of Passwork and PHP will be displayed. This is what a successful function completion looks like:

Example of successful Passwork migration