Skip to content
项目

pnp/script-samples

在 GitHub 查看

关于

示例脚本集,展示如何使用 PnP PowerShell、CLI for Microsoft 365、Graph SDK 等工具,通过 Bash 或 PowerShell 管理 Microsoft 365 的各项功能。

开发工具

这些数字如何统计

实测星标增长

24小时
0
7天
+1
15天
+3
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Community Script Samples

Community Script Samples gallery redesign preview with search, product filters, and script cards

Browse the script gallery | Get started | Share a sample

Gallery preview. The published site updates after this change is reviewed, merged, and deployed.

A little script. A lot less work. Explore 400+ real-world scripts for Copilot, Microsoft 365, Power Platform and more, shared by the community. Find a starting point, choose your tool, and make it your own.

Find scripts for SharePoint, Microsoft Graph, Teams, Microsoft Copilot, Power Platform, Azure, and more. Choose the tools you already use: PnP PowerShell, CLI for Microsoft 365, Microsoft Graph PowerShell, SharePoint Online Management Shell, Azure CLI, and others.

Find your next starting point

  1. Find a task: search the gallery for a scenario or command, or browse by product or tool.
  2. Choose an implementation: many samples offer more than one tool. Read the README and select the matching code tab.
  3. Review, adapt, and test: check prerequisites and permissions, replace placeholders, and test safely before using production data. Samples can modify or remove tenant data.

The scripts and their documentation live together under scripts/. No need to install or build the gallery to use or contribute a sample.

Your everyday script could make someone's day

New contributors are welcome. Share a useful scenario, add another tool to an existing sample, fix a bug, or improve the guidance. A focused contribution does not have to be a large one.

The New-Sample.ps1 generator creates a sample folder, README, metadata, tool tabs, and placeholder images. Run it from the cloned repository root in PowerShell 7, using your own name and GitHub handle:

.\New-Sample.ps1 -ScriptFolderName "spo-get-site-report" `
    -ScriptTitle "Report SharePoint sites" `
    -ScriptShortDescription "Export a SharePoint site inventory." `
    -ScriptTool PnPPowerShell `
    -AuthorFullName "Your name" `
    -GitHubId "your-github-handle"

Replace the generated script placeholder, finish the metadata, and add your preview. The step-by-step contribution guide explains what the generator does and what to finish before opening a pull request.

Not ready to write a sample? Report an issue, suggest a scenario, or help test an existing script. New to GitHub? Sharing is caring offers friendly, hands-on sessions.

Earn your Script Samples contributor badge

Microsoft 365 and Power Platform Community Script Samples contributor badge

Every sample contributor is eligible, including first-time contributors. After your first accepted sample, opt in to the community recognition program to receive your badge. Issuance is processed in batches, so it is not immediate.

Your contribution is credited in the sample. Share its gallery link with your team or community, and request a community demo slot to show what you learned. See contributor recognition for details.

Learn and share with the community

This is an open-source community project maintained by volunteers. Thank you to everyone who shares code, reports issues, and helps others get started.

Work on the gallery

The site uses Astro and TypeScript. With Node.js 22.19 or later, run npm --prefix site ci, then npm --prefix site run dev and open http://localhost:4321/script-samples/.

Local development, validation, and deployment | Migration and GitHub Pages cutover notes

Code of Conduct

This repository has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Disclaimer

THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

Sharing is caring!

探索相关项目

加载中…