Upgrade a ScriptoForm
For an existing ScriptoForm that you have already built, you may want to update it to support a newer version of PowerShell. If you have compiled the ScriptoForm into an executable, you may want to update and recompile it to support a newer Microsoft .NET runtime. Use the guidelines below to assist with performing these actions.
PowerShell Upgrades
Section titled “PowerShell Upgrades”Typically, there are few changes that need to be made to a ScriptoForm in order to support a newer version of PowerShell. In most cases you will only need to update the project “README.md” file to note which versions of PowerShell are supported (example file shown below):
## Requirements- This project supports the following command shells: - [Windows PowerShell 5.1](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-5.1) - [PowerShell 7.4.x](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.4) - [PowerShell 7.5.x](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.5) - [PowerShell 7.6.x](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.6) - [PowerShell 7.7.x](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.7)- This project supports the following Microsoft .NET frameworks: - [Microsoft .NET 4.x](https://dotnet.microsoft.com/en-us/download/dotnet-framework) - [Microsoft .NET 10.x](https://dotnet.microsoft.com/en-us/download/dotnet/10.0) - [Microsoft .NET 11.x](https://dotnet.microsoft.com/en-us/download/dotnet/11.0)Additional Information
Section titled “Additional Information”Microsoft .NET Upgrades
Section titled “Microsoft .NET Upgrades”When a new version of Microsoft .NET is released or an existing version has fallen out of support, you will need to perform the following steps on an existing ScriptoForm project to match the supported versions.
- If you have not done so already: Install the latest SmartAceDesigns.ScriptoFormTemplates PowerShell module from the PowerShell Gallery:
PowerShell Install-Module -Name SmartAceDesigns.ScriptoFormTemplatesPowerShell Install-PSResource -Name SmartAceDesigns.ScriptoFormTemplates - If you have not done so already: Download and install the latest Microsoft .NET SDK using your preferred method: Microsoft .NET SDK
- Within your project edit the “/Build/Build.csproj” file and update the
<TargetFrameworks>line to include only the latest supported Microsoft .NET versions:Build.csproj <PropertyGroup><AssemblyName>Your-ProjectName></AssemblyName><ApplicationIcon></ApplicationIcon><OutputType>WinExe</OutputType><GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute><GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute><GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute><GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute><GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute><TargetFrameworks>net48;net10.0-windows;net11.0-windows</TargetFrameworks><RuntimeIdentifier>win-x64</RuntimeIdentifier><DebugType>None</DebugType><Configuration>Release</Configuration><SelfContained>false</SelfContained><PublishSingleFile Condition="'$(TargetFramework)' != 'net48'">true</PublishSingleFile></PropertyGroup> - Update the “README.md” file in the project to note which versions of the Microsoft .NET framework are supported (example file shown below):
README.md ## Requirements- This project supports the following command shells:- [Windows PowerShell 5.1](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-5.1)- [PowerShell 7.6.x](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.6)- [PowerShell 7.7.x](https://docs.microsoft.com/en-us/powershell/scripting/overview?view=powershell-7.7)- This project supports the following Microsoft .NET frameworks:- [Microsoft .NET 4.x](https://dotnet.microsoft.com/en-us/download/dotnet-framework)- [Microsoft .NET 8.x](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)- [Microsoft .NET 9.x](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)- [Microsoft .NET 10.x](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)- [Microsoft .NET 11.x](https://dotnet.microsoft.com/en-us/download/dotnet/11.0) - Recompile the executable.
Additional Information
Section titled “Additional Information”Microsoft .NET and .NET Core Support Policy
PowerShell MSIX Package Upgrades
Section titled “PowerShell MSIX Package Upgrades”Starting with PowerShell 7.7, support for MSI installations has been dropped and an MSIX package must be used instead. This fundamentally changes how the compilation process works and requires updates to the “\Build\Build.cs” and “\Build\Build.csproj” files in an existing project. New projects deployed from the latest version of the SmartAceDesigns.ScriptoFormTemplates PowerShell module will automatically include these changes and will NOT require the manual updates described below.
If you plan to upgrade to PowerShell 7.7 or later AND are compiling your ScriptoForm project into an executable, you will need to perform the following steps on existing projects:
- Follow steps 1-4 from the instructions above: Microsoft .NET Upgrades
- Replace the existing \Build\Build.cs file in your project directory with the updated version from the latest SmartAceDesigns.ScriptoFormTemplates PowerShell module that is installed on your development computer. This is typically here:
“%USERPROFILE%\Documents\PowerShell\Modules\SmartAceDesigns.ScriptoFormTemplates\####-##-#\Templates\Common\Build”
Where: “####-##-#” is the version number of the module installed. Please note that this path may vary depending on your environment. - Edit the existing \Build\Build.csproj file in your project directory and add the following highlighted lines:
Build.csproj <PropertyGroup><AssemblyName>Your-ProjectName></AssemblyName><ApplicationIcon></ApplicationIcon><OutputType>WinExe</OutputType><GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute><GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute><GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute><GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute><GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute><TargetFrameworks>net48;net10.0-windows;net11.0-windows</TargetFrameworks><RuntimeIdentifier>win-x64</RuntimeIdentifier><DebugType>None</DebugType><Configuration>Release</Configuration><SelfContained>false</SelfContained><PublishSingleFile Condition="'$(TargetFramework)' != 'net48'">true</PublishSingleFile></PropertyGroup> - Recompile the executable.