Skip to content

New-PlasterManifest : Add a confirmation message before rewrite existing file #230

Closed

Description

@LaurentDardenne

This call rewrite existing file without ask a confirmation :

New-PlasterManifest -TemplateName Test

And may be add -force parameter.
The 'C:\temp\plasterManifest.xml' file is Read/only (Attrib +r)

New-PlasterManifest -TemplateName Test
Exception calling "Create" with "2" argument(s): "L'accès au chemin d'accès 'C:\temp\plasterManifest.xml' est refusé."
At C:\Program Files\WindowsPowerShell\Modules\Plaster\1.0.1\NewPlasterManifest.ps1:116 char:17
+ ...             $xmlWriter = [System.Xml.XmlWriter]::Create($resolvedPath ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : UnauthorizedAccessException

Activity

  1. rkeithhill commented on Feb 6, 2017

    @rkeithhill
    Collaborator

    Hmm, I modelled this command after the New-ModuleManifest command. It doesn't provide a Force parameter. It just whacks the existing file. I guess you could argue that New-ModuleManifest isn't a great example. :-)

  2. LaurentDardenne commented on Feb 7, 2017

    @LaurentDardenne
    Author

    "I guess you could argue that New-ModuleManifest isn't a great example."
    No, I am writing a french tutorial about Plaster and i try this :

    Install-Module Plaster
    $M=Import-module Plaster -PassThru
    cd $M.ModuleBase
    cd Templates\NewPowerShellManifestModule
    New-PlasterManifest -TemplateName Test

    Oups !!!
    Now i know :-)

  3. locked and limited conversation to collaborators on Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions