I have a PowerShell script that reads a register.psd1 file with contents as below.
@{
# Building Zig compiler
zig = @{
name = "zig"
path = ./python/buildzig.py
language = "Python"
os = "all"
}
# Building Windows Terminal for Windows 10.
windowsterminal = @{
name = "WindowsTerminal"
path = ./powershell/msterminal.ps1
language = "Python"
os = "windows"
}
}
I read the file using the following command.
Import-PowerShellDataFile -Path register.psd1
After running the script I get the following error message.
Import-PowerShellDataFile : Cannot generate a PowerShell object for a ScriptBlock evaluating dynamic expressions.
What am I doing wrong and what is the possible solution?