You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PowerShell scripts written for older versions of WinDD will stop working and must be updated. To update them:
If you are using a script from the WDD-scripts repo, download the latest version from here.
If you have written any custom scripts, see below for how to revise them.
Updating custom scripts
To read the values of input parameters in a custom script, add the line below to the top of your script and access them like this: $params.daySegment2
$params=$Input|ConvertFrom-Json
Before WinDD 5.5, the method of receiving parameters in a PowerShell script was like this:
param (
[Parameter(Mandatory=$true)][int]$daySegment2,# 0 = Day, 1 = Night
[Parameter(Mandatory=$true)][int]$daySegment4,# -1 = N/A, 0 = Sunrise, 1 = Day, 2 = Sunset, 3 = Night
[Parameter(Mandatory=$true)][bool]$nightMode,# True if night mode is enabled
[Parameter(Mandatory=$false)][string]$imagePath# Path to current wallpaper image
)
Why did scripts break?
This change was made to support the addition of day mode. The parameters that were previously passed to PowerShell scripts included a boolean nightMode that was no longer adequate to represent a 3 state value of Automatic, Light Mode, or Dark Mode. By replacing a hard-coded list of arguments with a dynamic JSON object, the parameter structure passed to PowerShell scripts is now more flexible and should allow for changes to be made in the future.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
PowerShell scripts written for older versions of WinDD will stop working and must be updated. To update them:
Updating custom scripts
To read the values of input parameters in a custom script, add the line below to the top of your script and access them like this:
$params.daySegment2
Before WinDD 5.5, the method of receiving parameters in a PowerShell script was like this:
Why did scripts break?
This change was made to support the addition of day mode. The parameters that were previously passed to PowerShell scripts included a boolean
nightMode
that was no longer adequate to represent a 3 state value of Automatic, Light Mode, or Dark Mode. By replacing a hard-coded list of arguments with a dynamic JSON object, the parameter structure passed to PowerShell scripts is now more flexible and should allow for changes to be made in the future.Beta Was this translation helpful? Give feedback.
All reactions