Giter Club home page Giter Club logo

platyps's Introduction

logo PowerShell

Welcome to the PowerShell GitHub Community! PowerShell is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework that works well with your existing tools and is optimized for dealing with structured data (e.g. JSON, CSV, XML, etc.), REST APIs, and object models. It includes a command-line shell, an associated scripting language, and a framework for processing cmdlets.

Windows PowerShell vs. PowerShell 7+

Although this repository started as a fork of the Windows PowerShell codebase, changes made in this repository are not ported back to Windows PowerShell 5.1. This also means that issues tracked here are only for PowerShell 7.x and higher. Windows PowerShell specific issues should be reported with the Feedback Hub app, by choosing "Apps > PowerShell" in the category.

New to PowerShell?

If you are new to PowerShell and want to learn more, we recommend reviewing the getting started documentation.

Get PowerShell

PowerShell is supported on Windows, macOS, and a variety of Linux platforms. For more information, see Installing PowerShell.

Upgrading PowerShell

For best results when upgrading, you should use the same install method you used when you first installed PowerShell. The update method is different for each platform and install method.

Community Dashboard

Dashboard with visualizations for community contributions and project status using PowerShell, Azure, and PowerBI.

For more information on how and why we built this dashboard, check out this blog post.

Discussions

GitHub Discussions is a feature to enable free and open discussions within the community for topics that are not related to code, unlike issues.

This is an experiment we are trying in our repositories, to see if it helps move discussions out of issues so that issues remain actionable by the team or members of the community. There should be no expectation that PowerShell team members are regular participants in these discussions. Individual PowerShell team members may choose to participate in discussions, but the expectation is that community members help drive discussions so that team members can focus on issues.

Create or join a discussion.

Chat

Want to chat with other members of the PowerShell community?

There are dozens of topic-specific channels on our community-driven PowerShell Virtual User Group, which you can join on:

Building the Repository

Linux Windows macOS
Instructions Instructions Instructions

If you have any problems building, consult the developer FAQ.

Build status of nightly builds

Azure CI (Windows) Azure CI (Linux) Azure CI (macOS) CodeFactor Grade
windows-nightly-image linux-nightly-image macOS-nightly-image cf-image

Downloading the Source Code

You can clone the repository:

git clone https://github.com/PowerShell/PowerShell.git

For more information, see working with the PowerShell repository.

Developing and Contributing

Please look into the Contribution Guide to know how to develop and contribute. If you are developing .NET Core C# applications targeting PowerShell Core, check out our FAQ to learn more about the PowerShell SDK NuGet package.

Also, make sure to check out our PowerShell-RFC repository for request-for-comments (RFC) documents to submit and give comments on proposed and future designs.

Support

For support, see the Support Section.

Legal and Licensing

PowerShell is licensed under the MIT license.

Windows Docker Files and Images

License: By requesting and using the Container OS Image for Windows containers, you acknowledge, understand, and consent to the Supplemental License Terms available on Microsoft Artifact Registry.

Telemetry

Please visit our about_Telemetry topic to read details about telemetry gathered by PowerShell.

Governance

The governance policy for the PowerShell project is described the PowerShell Governance document.

Please see our Code of Conduct before participating in this project.

For any security issues, please see our Security Policy.

platyps's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

platyps's Issues

Generic way to customize generated markdown

This is far in the future, but I want to capture this idea now.

There are write-only scenarios for generated markdown:
Examples:

It may be desirable to customize them somehow. I.e. do post-processing on cross-references to link them appropriately.

Something to have in mind for future.

Address parser performance issues

MarkdownStringToMamlString must be fast (less then a minute for this file)

$markdown = cat .\Examples\SMA.Help.md -Raw
$generatedMaml = [Markdown.MAML.Renderer.MamlRenderer]::MarkdownStringToMamlString($markdown)

Add cabinet creation cmdlet to PlatyPs

Add the ability to compress prepared help files to a cabinet. This enables the creation of downloadable packages that can be used with Update-Help. Use MakeCab.exe as it is commonly available on Windows operating systems.

New Functionality - New-PlatyPsCabinet

Add a script cmdlet to platyPs that will utilize the makecab.exe to compress target files into a cabinet.
The name of the cab which must be particular for the PowerShell help engine to find and extract, will be based on the params provided for Module Name, GUID, and Locale.

Required Params

In order to correctly name a cab

    [Cmdletbinding()]
    param(
        [parameter(Mandatory=$true)]
        [string] $Source,
        [parameter(Mandatory=$true)]
        [string] $Destination,
        [parameter(Mandatory=$true)]
        [string] $Module,
        [parameter(Mandatory=$true)]
        [string] $Locale,
        [parameter(Mandatory=$true)]
        [string] $Guid
    )

Source

The source directory containing all of the files to be added to the cab. Non-Recursive.

Destination

The output directory to create the cab file. It should create a reusable folder structure:

\CabFile\
           \datetime cmdlet was run\
           \latest\

This folder structure will allow the output to be added to the latest folder, as well as a time stamped directory for historical purposes.

Module

The name of the module as it appears in the PowerShell console when Get-Command -ListAvailable is run.

Locale

The language code the of the help the cab will contain:
xx-XX format, ie: en-US or fr-FR or es-ES

Guid

The GUID of the PowerShell module.
Typically alphanumeric XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

Module Naming Convention

The help system in PowerShell requires that Cabs have a specific name scheme in order for Update-Help to find the package, download, and extract it.

<ModuleName>_<ModuleGuid>_<Locale>_helpcontent.cab

Output

Using the destination param, the cab file will be output to a target destination.

Generate MD stubs via module reflection

This is the initial generation of "stub reference" documentation in Markdown for a new module.

Scenario here is to first finish the module and then to generate documentation for later annotation.

Is #### {Input type} by design?

in platyPS.schema.md, {Input type} is preceded by four #, where I would have expected the nesting level to be at three #, as is the case for {Parameter name}, {Output type} and {Example Name}.

Is this a design choice or a nesting error introduced in bbeba47?

April/May 2016 Deliveries

  • Finalize on cmdlet Template - Issue #34 - Complete by April 14
  • Updating published Markdowns with new code changes in the PS Module -Issue #38 - Complete by May 13
  • Need a solution to generate Providers and About - Issue #37 - Complete by June 3
  • Add cabinet creation cmdlet to PlatyPS - Issue #35 - Complete by April 22
  • Add help.xml proper naming conversion cmdlet to PlatyPS - Issue #36 - Complete by May 10
  • Add metadata block support (for BI) in the schema - Completed
  • Add cmdlet for upgrade from schema - Issue #49 - Complete by May 13

Need a solution to generate About topics

This ask was split later, in thread, keep reading....
PlatyPS doesn't yet have a solution to generate providers data. Need a solution in place to handle this content.

Dynamic Param of type Swtich defaulting to mandatory.

I have a function that has a dynamic param set, and there is a switch that is not mandatory, but it is not explicitly set to false, and the markdown outputs Mandatory as true. If I add Mandatory = $false it will output correctly, so I am guessing it is just defaulting to $true?

*edit
this only seems to happen on param of Type Switch, i have a String param, that one is also not mandatory, and not explicitly defined as such, but it outputs as mandatory: False.

Add help.xml proper naming convention cmdlet to PlatyPs

Add a cmdlet to PlatyPs the properly names a help.xml file for use.
Help files need to be specifically named in order for the PowerShell help engine to find them. There must be a help file corresponding to each cmdlet-providing code file, DLL, CDXML, PSM1.

New Functionality - Format-PlatyPsHelpXml

This cmdlet will take the name of a file that contains the code for a Powershell module's cmdlets. It will also take in the source help.xml file. Using these two things, the cmdlet will generate a help.xml file that is properly named and can be consumed by the PowerShell help engine.

Required Params

[Cmdletbinding()]
    param(
        [parameter(Mandatory=$true)]
        [string] $HelpFileSourceXml,
        [parameter(Mandatory=$true)]
        [string] $ModuleFileName,
        [parameter(Mandatory=$true)]
        [string] $Destination
    )

File naming convention

The help system in PowerShell requires that help.xml files have a specific name scheme in order for Get-Help to find the documentation and display it in the help console.

<ModuleCodeFileName>-help.xml

Make one cmdlet per file the default

Per discussion in #20 , everybody agreed that it's a good idea to enforce one cmdlet per file policy for the help. Hence, we should make it the default.

I would not pull out support for multiply cmdlets in the same file, but an APIs to bootstrap such markdown would be de-promoted from default to exotic.

Example to view generated help errors out

This is what I get:

107> $generatedModule.Cmdlets | % { Get-Help -Name "$($generatedModule.Name)\$_" -Full | Out-String }
Get-Help : Get-Help could not find testplay.psm1-Help.xml_2139322656\Edit-File in a help file in this session. To
download updated help topics type: "Update-Help". To get help online, search for the help topic in the TechNet library
at http://go.microsoft.com/fwlink/?LinkID=107116.
At line:1 char:32
+ ... dlets | % { Get-Help -Name "$($generatedModule.Name)\$_" -Full | Out- ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException
    + FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand

Could it be that your example is working because you're working in the platyPS out dir (where there is a real module)?

Cmdlets renaming

I think current name looks pretty unfun.
I'd like to drop platyPS prefix and do other small tweaks.

  • Get-PlatyPSMarkdown -> New-Markdown (semantic changed after #51, so verb change)
  • Get-PlatyPSYamlMetadata -> Get-MarkdownMetadata
  • Get-PlatyPSExternalHelp -> New-ExternalHelp (we want to embeed information about naming convention in markdown metadata, so semantic would change: it would drop a file on the disk)
  • Get-PlatyPSTextHelpFromMaml -> Show-HelpPreview
  • New-PlatyPSCab -> New-ExternalHelpCab
  • Format-PlatyPsHelpXml -> $null (we will spreed this functionality across New-ExternalHelpCab and New-ExternalHelp)
  • new cmdlet from #49 -> Update-Markdown

cc @jongeller

Dynamic Parameters support

yesterday, my dynamic parameter sets where getting exported in New-Markdown, but this is no longer happening as of building this morning.

Simplified Markdown Parser mode to preserve original formatting

Hyperlinks currently handed far from perfect.

  • Our pattern uses @"\[(.+?)\]\((https?://[^'\"">\s]+)?\)" regex to recognize them. It would not treat relative github links as hyper-links.
  • After a full circle unrecognized link would gain additional escaping, so it would be rendered improperly

Generate the correct MAML filenames

Filenames need to have the full XML filename that is compatible all the way to PS 3.0. This differs across script, binary, CDXML, and provider cmdlets.

Get-Help -Online parameter, required functionality

Creating this issue to ensure we test this functionality
When get-help is run against a cmdlets, if the -online parameter is used, an web page will be opened where the published version of the help can be seen.

The link data is available in the related links section, but the documentation authors need to be sure this will work once the conversion from MD to MAML is performed.

Get-Help Add-Computer -online
#links to: 
#https://technet.microsoft.com/library/712f3460-c5d0-4af8-8de6-6d06e4a1a838(v=wps.630).aspx

This link, is stored in the MAML related links section here, note the Online Version text:

    <maml:relatedLinks>
      <maml:navigationLink>
        <maml:linkText>Online Version:</maml:linkText>
        <maml:uri>http://go.microsoft.com/fwlink/p/?linkid=290488</maml:uri>
      </maml:navigationLink>
    </maml:relatedLinks>

Do we want to keep Common Parameters with explicit help entries?

There are common parameters in PowerShell.

There is a content help difference between v4 and v5

> (Get-Help Add-Computer).syntax.syntaxItem[0].Parameter.Name | ? {$_ -like 'info*'}
# in v5
InformationAction
InformationVariable
# in v4 nothing

To resolve it properly, I'd like to rise a conceptual question:
Is it a legitimate scenario to include explicit entry about particular common parameter in help?

Suggestion for generated markdown header

Hello! This tool looks great, and I plan to use this to help automate my github wiki very soon! However, I see in the newest version (from the repo, not from the PoSh Gallery) that the New-Markdown shows a header, even on your pages. For instance:


---
external help file: gShell.dll-Help.xml
schema: 2.0.0

---

At the very least can this be moved to the bottom and/or become optional with a switch like you'd see with Export-Csv -NoTypeInformation?

I'm hip deep in things at the moment, but I can look in to making a pull request sometime this week if that would make things any faster.

Thanks for your consideration!

New cmdlet Test-Markdown

Scenarios:

  • Verify that markdown is compliant with schema
  • Verify / report that all text fields are filled (i.e. NOTES, description placeholders)

Scenarios to consider:

  • Verify markdown metadata keys. It's needed for a large scale pipelines, i.e. if MS adopts platyPS. Maybe create a Test-MarkdownMetadata instead?

Schema 2.0.0: add a hypen in front of parameter names

Before:

ScriptBlock

The ScriptBlock is called when the Chord is entered. The ScriptBlock is passed one or sometimes two arguments. The first argument is the key pressed (a ConsoleKeyInfo.) The second argument could be any object depending on the context.

Type: ScriptBlock
Parameter Sets: Set 1
Aliases: 

Required: True
Position: 1
Default value: 
Accept pipeline input: false
Accept wildcard characters: False

After:

-ScriptBlock

The ScriptBlock is called when the Chord is entered. The ScriptBlock is passed one or sometimes two arguments. The first argument is the key pressed (a ConsoleKeyInfo.) The second argument could be any object depending on the context.

Type: ScriptBlock
Parameter Sets: Set 1
Aliases: 

Required: True
Position: 1
Default value: 
Accept pipeline input: false
Accept wildcard characters: False

What do you think? We need to make a decision by Tuesday

Fix documentation

Before next release

  • src\platyPS\docs
  • README.md with updated scenarios

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.