Skip to content

Commit

Permalink
Merge pull request #766 from pkbullock/main
Browse files Browse the repository at this point in the history
Site Improvements
  • Loading branch information
pkbullock authored Oct 31, 2024
2 parents 60738a9 + 7b96df6 commit 8693aae
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 10 deletions.
Binary file added docfx/assets/contributing/new-sample-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions docfx/contributing/preparing-a-submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Then find the repository at [https://github.com/pnp/script-samples](https://gith

Before you can submit, you need to make sure you are setup with a "fork" of the repository in your own account, please navigate to [Submitting Pull Requests](submitting-pull-requests.md) for setup information.


## Use a code tour

We have added a code tour to help you create a sample from the template. In order to use, this, you will need to install the extension into Visual Studio Code called "CodeTour", details of how this works, see [CodeTour | Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour)
Expand All @@ -31,6 +32,35 @@ The template submission folder contains:
> Please note: this isn't an expected sample style, quality or format, or a gold standard just an idea if you feel you need some ideas on how to present your script. <br /><br />
> We fully understand that there any multiple styles and approaches, and __we are happy to accept the submission in your style__ 😊

**Alternatively, you can use PowerShell...**

We have added a PowerShell script to help you generate the scaffolding for a NEW sample, making it faster for you to submit. It does not add to an existing sample a new variation.

In the root of the repo, you will find ```New-Sample.ps1``` this PowerShell script accepts the following parameters:

| Property | Example | Description |
|----------|---------|-------------|
| -ScriptFolderName | "spo-dev-tenant-report-export" | Folder format for the sample itself. Lowercase, workload prefix |
| -ScriptTitle | "Report and Export Solutions from M365 Developer Tenant" | Title of your sample script |
| -ScriptShortDescription | "Expiring tenant or need..." | Short Description of what the sample does |
| -ScriptTool | PnPPowerShell | Multiple options supported here e.g. 'PnPPowerShell','CliForMicrosoft365', 'SPOManagementShell', 'CliForMicrosoft365Bash', 'MicrosoftGraphPowerShell', 'AzureCli', 'PowerAppsPowerShell', 'MicrosoftTeamsPowerShell', 'All' |
| -AuthorFullName | "Paul Bullock" | Your name, so we can credit you |
| -GitHubId | "pkbullock" | Your GitHub handle |

Example:

```powershell
.\New-Sample.ps1 -ScriptFolderName "spo-dev-tenant-report-export" `
-ScriptTitle "Report and Export Solutions from M365 Developer Tenant" `
-ScriptShortDescription "Expiring tenant or need to understand what you have created in the past, report and optionally export your projects and solutions"
-ScriptTool PnPPowerShell `
-AuthorFullName "Paul Bullock" `
-GitHubId "pkbullock"
```

![Example of output from parameters](../assets/contributing/new-sample-output.png)

## Page Structure

The page follows a standard format, we have created a graphic to explain the layout and the markdown for each section:
Expand Down
2 changes: 1 addition & 1 deletion docfx/includes/MORE-PNPPS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
> [!div class="highlight-tool"]
> Check out the **PnP PowerShell** to learn more at: https://aka.ms/pnp/powershell
> [!div class="highlight-tool-red"]
> [!div class="highlight-tool"]
> The way you login into PnP PowerShell has changed please read [PnP Management Shell EntraID app is deleted : what should I do ?](https://github.com/pnp/powershell/discussions/4249)
16 changes: 7 additions & 9 deletions docfx/report-matrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ $files | Foreach-Object {

# Output Report

"`nThere are **{0}** scenarios and **{1}** scripts in the site | Generated: {2} `n`n" -f $matrixRows.Length, $sampleCount, [System.DateTime]::Now.ToString("dd MMM yyyy hh:mm:ss") `
| Out-File $reportFile -Append

"`rPnP PowerShell: {0} <br />Cli for Microsoft 365 PowerShell: {1}<br />Cli for Microsoft 365 Bash: {2}<br />Graph SDK: {3}<br />SPO Management SDK: {4}<br /> All Tabs: {5}<br /><br />" `
-f $PnPPSCount, $CLIPSCount, $CLIBashCount, $GraphSDKCount, $SPOMSCount, $AllTabs `
| Out-File $reportFile -Append

$matrixRows | ForEach-Object{

Expand All @@ -154,12 +160,4 @@ $matrixRows | ForEach-Object{

# Counts
$row = "| - | {0} | {1} | {2} | {3} | {4} |" -f $PnPPSCount, $CLIPSCount, $CLIBashCount, $GraphSDKCount, $SPOMSCount
$row | Out-File $reportFile -Append


"`nThere are **{0}** scenarios and **{1}** scripts in the site | Generated: {2} `n`n" -f $matrixRows.Length, $sampleCount, [System.DateTime]::Now.ToString("dd MMM yyyy hh:mm:ss") `
| Out-File $reportFile -Append

"`rPnP PowerShell: {0} <br />Cli for Microsoft 365 PowerShell: {1}<br />Cli for Microsoft 365 Bash: {2}<br />Graph SDK: {3}<br />SPO Management SDK: {4}<br /> All Tabs: {5}<br /><br />" `
-f $PnPPSCount, $CLIPSCount, $CLIBashCount, $GraphSDKCount, $SPOMSCount, $AllTabs `
| Out-File $reportFile -Append
$row | Out-File $reportFile -Append

0 comments on commit 8693aae

Please sign in to comment.