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
refactor(Plaster): ✨ Improve localized data import and error handling
* Refactored the import of localized data to use a splatting approach for better readability and maintainability.
* Enhanced error handling during the import process to provide clearer warnings.
* Updated the `Start-ProcessFile` function to improve parameter resolution with splatting.
* Cleaned up the `Plaster.Resources.psd1` file by removing unnecessary comments and ensuring proper formatting.
Copy file name to clipboardExpand all lines: Plaster/Plaster.psm1
+6-70Lines changed: 6 additions & 70 deletions
Original file line number
Diff line number
Diff line change
@@ -1,76 +1,12 @@
1
1
# spell-checker:ignore Multichoice Assigments
2
-
# Import localized data
3
-
data LocalizedData {
4
-
# culture="en-US"
5
-
ConvertFrom-StringData@'
6
-
DestPath_F1=Destination path: {0}
7
-
ErrorFailedToLoadStoreFile_F1=Failed to load the default value store file: '{0}'.
8
-
ErrorProcessingDynamicParams_F1=Failed to create dynamic parameters from the template's manifest file. Template-based dynamic parameters will not be available until the error is corrected. The error was: {0}
9
-
ErrorTemplatePathIsInvalid_F1=The TemplatePath parameter value must refer to an existing directory. The specified path '{0}' does not.
10
-
ErrorUnencryptingSecureString_F1=Failed to unencrypt value for parameter '{0}'.
11
-
ErrorPathDoesNotExist_F1=Cannot find path '{0}' because it does not exist.
12
-
ErrorPathMustBeRelativePath_F2=The path '{0}' specified in the {1} directive in the template manifest cannot be an absolute path. Change the path to a relative path.
13
-
ErrorPathMustBeUnderDestPath_F2=The path '{0}' must be under the specified DestinationPath '{1}'.
14
-
ExpressionInvalid_F2=The expression '{0}' is invalid or threw an exception. Error: {1}
ManifestFileMissing_F1=The Plaster manifest file '{0}' was not found.
26
-
ManifestMissingDocElement_F2=The Plaster manifest file '{0}' is missing the document element. It should be specified as <plasterManifest xmlns="{1}"></plasterManifest>.
27
-
ManifestMissingDocTargetNamespace_F2=The Plaster manifest file '{0}' is missing or has an invalid target namespace on the document element. It should be specified as <plasterManifest xmlns="{1}"></plasterManifest>.
28
-
ManifestPlasterVersionNotSupported_F2=The template file '{0}' specifies a plasterVersion of {1} which is greater than the installed version of Plaster. Update the Plaster module and try again.
29
-
ManifestSchemaInvalidAttrValue_F5=Invalid '{0}' attribute value '{1}' on '{2}' element in file '{3}'. Error: {4}
30
-
ManifestSchemaInvalidCondition_F3=Invalid condition '{0}' in file '{1}'. Error: {2}
31
-
ManifestSchemaInvalidChoiceDefault_F3=Invalid default attribute value '{0}' for parameter '{1}' in file '{2}'. The default value must specify a zero-based integer index that corresponds to the default choice.
32
-
ManifestSchemaInvalidMultichoiceDefault_F3=Invalid default attribute value '{0}' for parameter '{1}' in file '{2}'. The default value must specify one or more zero-based integer indexes in a comma separated list that correspond to the default choices.
33
-
ManifestSchemaInvalidRequireModuleAttrs_F2=The requireModule attribute 'requiredVersion' for module '{0}' in file '{1}' cannot be used together with either the 'minimumVersion' or 'maximumVersion' attribute.
34
-
ManifestSchemaValidationError_F2=Plaster manifest schema error in file '{0}'. Error: {1}
35
-
ManifestSchemaVersionNotSupported_F2=The template's manifest schema version ({0}) in file '{1}' requires a newer version of Plaster. Update the Plaster module and try again.
ManifestNotValid_F1=The Plaster manifest '{0}' is not valid.
38
-
ManifestNotValidVerbose_F1=The Plaster manifest '{0}' is not valid. Specify -Verbose to see the specific schema errors.
39
-
ManifestNotWellFormedXml_F2=The Plaster manifest '{0}' is not a well-formed XML file. {1}
40
-
ManifestWrongFilename_F1=The Plaster manifest filename '{0}' is not valid. The value of the Path argument must refer to a file named 'plasterManifest.xml' or 'plasterManifest_<culture>.xml'. Change the Plaster manifest filename and then try again.
41
-
MissingParameterPrompt_F1=<Missing prompt value for parameter '{0}'>
42
-
NewModManifest_CreatingDir_F1=Creating destination directory for module manifest: {0}
43
-
OpConflict=Conflict
44
-
OpCreate=Create
45
-
OpForce=Force
46
-
OpIdentical=Identical
47
-
OpMissing=Missing
48
-
OpModify=Modify
49
-
OpUpdate=Update
50
-
OpVerify=Verify
51
-
OverwriteFile_F1=Overwrite {0}
52
-
ParameterTypeChoiceMultipleDefault_F1=Parameter name {0} is of type='choice' and can only have one default value.
53
-
RequireModuleVerified_F2=The required module {0}{1} is already installed.
54
-
RequireModuleMissing_F2=The required module {0}{1} was not found.
ShouldProcessNewModuleManifest=Create new module manifest
62
-
TempFileOperation_F1={0} into temp file before copying to destination
63
-
TempFileTarget_F1=temp file for '{0}'
64
-
TestPlasterNoXmlSchemaValidationWarning=The version of .NET Core that PowerShell is running on does not support XML schema-based validation. Test-PlasterManifest will operate in "limited validation" mode primarily verifying the specified manifest file is well-formed XML. For full, XML schema-based validation, run this command on Windows PowerShell.
ErrorFailedToLoadStoreFile_F1=Failed to load the default value store file: '{0}'.
7
-
ErrorProcessingDynamicParams_F1=Failed to create dynamic parameters from the template's manifest file. Template-based dynamic parameters will not be available until the error is corrected. The error was: {0}
8
-
ErrorTemplatePathIsInvalid_F1=The TemplatePath parameter value must refer to an existing directory. The specified path '{0}' does not.
9
-
ErrorUnencryptingSecureString_F1=Failed to unencrypt value for parameter '{0}'.
10
5
ErrorPathDoesNotExist_F1=Cannot find path '{0}' because it does not exist.
11
6
ErrorPathMustBeRelativePath_F2=The path '{0}' specified in the {1} directive in the template manifest cannot be an absolute path. Change the path to a relative path.
12
7
ErrorPathMustBeUnderDestPath_F2=The path '{0}' must be under the specified DestinationPath '{1}'.
13
-
ExpressionInvalid_F2=The expression '{0}' is invalid or threw an exception. Error: {1}
ErrorProcessingDynamicParams_F1=Failed to create dynamic parameters from the template's manifest file. Template-based dynamic parameters will not be available until the error is corrected. The error was: {0}
9
+
ErrorTemplatePathIsInvalid_F1=The TemplatePath parameter value must refer to an existing directory. The specified path '{0}' does not.
10
+
ErrorUnencryptingSecureString_F1=Failed to unencrypt value for parameter '{0}'.
ManifestFileMissing_F1=The Plaster manifest file '{0}' was not found.
25
24
ManifestMissingDocElement_F2=The Plaster manifest file '{0}' is missing the document element. It should be specified as <plasterManifest xmlns="{1}"></plasterManifest>.
26
25
ManifestMissingDocTargetNamespace_F2=The Plaster manifest file '{0}' is missing or has an invalid target namespace on the document element. It should be specified as <plasterManifest xmlns="{1}"></plasterManifest>.
26
+
ManifestNotValid_F1=The Plaster manifest '{0}' is not valid.
27
+
ManifestNotValidVerbose_F1=The Plaster manifest '{0}' is not valid. Specify -Verbose to see the specific schema errors.
28
+
ManifestNotWellFormedXml_F2=The Plaster manifest '{0}' is not a well-formed XML file. {1}
27
29
ManifestPlasterVersionNotSupported_F2=The template file '{0}' specifies a plasterVersion of {1} which is greater than the installed version of Plaster. Update the Plaster module and try again.
28
30
ManifestSchemaInvalidAttrValue_F5=Invalid '{0}' attribute value '{1}' on '{2}' element in file '{3}'. Error: {4}
29
-
ManifestSchemaInvalidCondition_F3=Invalid condition '{0}' in file '{1}'. Error: {2}
30
31
ManifestSchemaInvalidChoiceDefault_F3=Invalid default attribute value '{0}' for parameter '{1}' in file '{2}'. The default value must specify a zero-based integer index that corresponds to the default choice.
32
+
ManifestSchemaInvalidCondition_F3=Invalid condition '{0}' in file '{1}'. Error: {2}
31
33
ManifestSchemaInvalidMultichoiceDefault_F3=Invalid default attribute value '{0}' for parameter '{1}' in file '{2}'. The default value must specify one or more zero-based integer indexes in a comma separated list that correspond to the default choices.
32
34
ManifestSchemaInvalidRequireModuleAttrs_F2=The requireModule attribute 'requiredVersion' for module '{0}' in file '{1}' cannot be used together with either the 'minimumVersion' or 'maximumVersion' attribute.
33
35
ManifestSchemaValidationError_F2=Plaster manifest schema error in file '{0}'. Error: {1}
34
36
ManifestSchemaVersionNotSupported_F2=The template's manifest schema version ({0}) in file '{1}' requires a newer version of Plaster. Update the Plaster module and try again.
ManifestNotValid_F1=The Plaster manifest '{0}' is not valid.
37
-
ManifestNotValidVerbose_F1=The Plaster manifest '{0}' is not valid. Specify -Verbose to see the specific schema errors.
38
-
ManifestNotWellFormedXml_F2=The Plaster manifest '{0}' is not a well-formed XML file. {1}
39
37
ManifestWrongFilename_F1=The Plaster manifest filename '{0}' is not valid. The value of the Path argument must refer to a file named 'plasterManifest.xml' or 'plasterManifest_<culture>.xml'. Change the Plaster manifest filename and then try again.
40
38
MissingParameterPrompt_F1=<Missing prompt value for parameter '{0}'>
41
39
NewModManifest_CreatingDir_F1=Creating destination directory for module manifest: {0}
@@ -49,20 +47,19 @@ OpUpdate=Update
49
47
OpVerify=Verify
50
48
OverwriteFile_F1=Overwrite {0}
51
49
ParameterTypeChoiceMultipleDefault_F1=Parameter name {0} is of type='choice' and can only have one default value.
52
-
RequireModuleVerified_F2=The required module {0}{1} is already installed.
53
-
RequireModuleMissing_F2=The required module {0}{1} was not found.
54
-
RequireModuleMinVersion_F1=minimum version: {0}
55
50
RequireModuleMaxVersion_F1=maximum version: {0}
51
+
RequireModuleMinVersion_F1=minimum version: {0}
52
+
RequireModuleMissing_F2=The required module {0}{1} was not found.
ShouldProcessNewModuleManifest=Create new module manifest
61
59
TempFileOperation_F1={0} into temp file before copying to destination
62
60
TempFileTarget_F1=temp file for '{0}'
63
61
TestPlasterNoXmlSchemaValidationWarning=The version of .NET Core that PowerShell is running on does not support XML schema-based validation. Test-PlasterManifest will operate in "limited validation" mode primarily verifying the specified manifest file is well-formed XML. For full, XML schema-based validation, run this command on Windows PowerShell.
0 commit comments