-
Notifications
You must be signed in to change notification settings - Fork 344
Open
Labels
Description
Describe the bug
Hello Team,
I am able to generate the PowerShell module using TypeSpec but build-module.ps1 is failing to build powershell module.
The reason for this failure is incorrect .psd1 file.
in generated .psd1 file functiontoExport is not defined and because of that build fails.
below is sample .psd1 file.
@{
GUID = 'eb86a394-c876-4c7d-b163-c3f93c11834f'
RootModule = './Demo.psm1'
ModuleVersion = '0.1.0'
CompatiblePSEditions = 'Core', 'Desktop'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'
Description = 'Microsoft Azure PowerShell: Demo cmdlets'
PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Demo.private.dll'
FormatsToProcess = './Demo.format.ps1xml'
**FunctionsToExport =**
PrivateData = @{
PSData = @{
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Demo'
LicenseUri = 'https://aka.ms/azps-license'
ProjectUri = 'https://github.com/Azure/azure-powershell'
ReleaseNotes = ''
}
}
}
Reproduction
- Create tspconfig.yaml
emit:
- "/root/holodeck/node/node_modules/@azure-tools/typespec-powershell"
options:
"/root/holodeck/node/node_modules/@azure-tools/typespec-powershell":
source-file: "../api/src/main/resources/openapi.yml"
service-name: "Holodeck"
module-name: "Holodeck"
is-data-plane: true
# PERMANENT FIX: Force valid PowerShell syntax for exports
additional-psd1-data:
FunctionsToExport: "*"
CmdletsToExport: "*"
-
Run
tsp compile . -
cd generated -
run
build-module.ps1
Checklist
- Follow our Code of Conduct
- Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable