From 1d4b2624d203d0a06387baba1d28229f7da7df9e Mon Sep 17 00:00:00 2001 From: George <1641829+finsharp@users.noreply.github.com> Date: Fri, 20 Nov 2020 04:10:14 +0300 Subject: [PATCH] Fix ArgumentNullException when Generating without docs `-NoDocs` switch (#711) * Fix ArgumentNullException when Generating without docs `-NoDocs` features. Pass along `-ExamplesFolder` since its required in all code paths. * Make examples mandatory, for all paramsets Co-authored-by: George Ndungu --- powershell/resources/assets/build-module.ps1 | 2 +- .../resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/powershell/resources/assets/build-module.ps1 b/powershell/resources/assets/build-module.ps1 index 5cdd3d4fb21..75ebe2b8d13 100644 --- a/powershell/resources/assets/build-module.ps1 +++ b/powershell/resources/assets/build-module.ps1 @@ -122,7 +122,7 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder if($NoDocs) { Write-Host -ForegroundColor Green 'Creating exports...' - Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder } else { Write-Host -ForegroundColor Green 'Creating exports and docs...' $moduleDescription = '${$project.metadata.description}' diff --git a/powershell/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/powershell/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index bd48d044646..875c2391aec 100644 --- a/powershell/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/powershell/resources/psruntime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -42,7 +42,7 @@ public class ExportProxyCmdlet : PSCmdlet [ValidateNotNullOrEmpty] public string DocsFolder { get; set; } - [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [Parameter(Mandatory = true)] [ValidateNotNullOrEmpty] public string ExamplesFolder { get; set; }