Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5e314a1
Update logos
erwinvanhunen Oct 5, 2020
9c892a7
Create dotnet-core.yml
erwinvanhunen Oct 6, 2020
3e95f28
Cleanup
erwinvanhunen Oct 6, 2020
5b817c7
cleanup
erwinvanhunen Oct 6, 2020
52f39f4
Delete dotnet-core.yml
erwinvanhunen Oct 6, 2020
90bb93f
Merge branch 'dev' of https://github.com/pnp/powershell into dev
erwinvanhunen Oct 6, 2020
3010e64
Added buildscripts
erwinvanhunen Oct 6, 2020
9d449b5
Create build.yml
erwinvanhunen Oct 6, 2020
71bcd00
Update build.yml
erwinvanhunen Oct 6, 2020
04dd7ec
moved folders
erwinvanhunen Oct 6, 2020
e6840ed
Merge branch 'dev' of https://github.com/pnp/powershell into dev
erwinvanhunen Oct 6, 2020
cc3d36f
Update build.yml
erwinvanhunen Oct 6, 2020
65a18a9
Updated solution file
erwinvanhunen Oct 6, 2020
0a1ce7b
project file cleanup
erwinvanhunen Oct 6, 2020
10b41a9
Updated .gitignore
erwinvanhunen Oct 6, 2020
fe9c7c7
updated build scripts
erwinvanhunen Oct 6, 2020
a041402
moved files
erwinvanhunen Oct 6, 2020
d39c03c
moved documentation
erwinvanhunen Oct 6, 2020
5bcca70
Updated
erwinvanhunen Oct 6, 2020
57aa5fa
added
erwinvanhunen Oct 6, 2020
0752cbf
Create publishtogallery.yml
erwinvanhunen Oct 6, 2020
0e5762c
updated script
erwinvanhunen Oct 6, 2020
79c33ad
Merge branch 'dev' of https://github.com/pnp/powershell into dev
erwinvanhunen Oct 6, 2020
cad1d4e
Updated
erwinvanhunen Oct 6, 2020
fb681bf
Updated
erwinvanhunen Oct 6, 2020
6e4fdb1
Updated
erwinvanhunen Oct 6, 2020
dd14fac
Commit from GitHub Actions
actions-user Oct 6, 2020
a3d085d
Update publishtogallery.yml
erwinvanhunen Oct 6, 2020
3ce3379
Updated
erwinvanhunen Oct 6, 2020
f85e548
Updated script
erwinvanhunen Oct 6, 2020
ae53668
Update publishtogallery.yml
erwinvanhunen Oct 6, 2020
9938c2c
Update Build-Release.ps1
erwinvanhunen Oct 6, 2020
ef31343
Update publishtogallery.yml
erwinvanhunen Oct 6, 2020
b249b3f
Update publishtogallery.yml
erwinvanhunen Oct 6, 2020
1a745c4
Commit from GitHub Actions
actions-user Oct 6, 2020
e0a0d36
renamed folder
erwinvanhunen Oct 7, 2020
47b7216
Fix version check
erwinvanhunen Oct 7, 2020
e055846
Fixed potential issue with connecting to an URL ending on a slash
erwinvanhunen Oct 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
workflow_dispatch:
push:
branches: [ dev ]
paths: 'src/**'
pull_request:
branches: [ dev ]
paths: 'src/**'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.301
- name: Install dependencies
run: dotnet restore
working-directory: src
- name: Build
run: dotnet build --configuration Release --no-restore
working-directory: src
- name: Test
run: dotnet test --no-restore --verbosity normal
working-directory: src
28 changes: 28 additions & 0 deletions .github/workflows/publishtogallery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Nightly Release to PowerShell Gallery

on:
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v2
with:
ref: dev
- name: Build and Publish Module
env:
POWERSHELLGALLERY_API_KEY: ${{ secrets.POWERSHELLGALLERY_API_KEY }}
shell: pwsh
run: |
./build/Build-Release.ps1
- name: Add & Commit
uses: EndBug/add-and-commit@v4.2.1
- name: Push changes to github
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: dev
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,5 @@ ModelManifest.xml

# TabsStudio generated files
*.tss

.vscode/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Renamed `Save-PnPProvisioningTemplate` to `Save-PnPSiteTemplate`.
- Renamed `Set-PnPProvisioningTemplateMetadata` to `Set-PnPSiteTemplateMetadata`.
- Renamed `Add-PnPProvisioningTemplate` to `Add-PnPSiteTemplate`.
- Renamed `Apply-PnPTenantTemplate` to `Invoke-PnPTenantTemplate`.
- Removed `Get-PnPAppInstance`. Use `Get-PnPApp` instead.
- Removed `Import-PnPAppPackage`. Use `Instal-PnPApp` instead.
- Removed `Uninstall-AppInstance`. Use `Uninstall-PnPApp` instead.
Expand Down
37 changes: 0 additions & 37 deletions Commands/Properties/AssemblyInfo.cs

This file was deleted.

12 changes: 0 additions & 12 deletions Commands/Properties/PublishProfiles/FolderProfile.pubxml

This file was deleted.

94 changes: 0 additions & 94 deletions PostBuild.ps1

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Summary ###
This solution contains a library of PowerShell commands that allows you to perform complex provisioning and artifact management actions towards SharePoint. The commands use a combination of CSOM and REST behind the scenes, and can work against both SharePoint Online as SharePoint On-Premises.

![Microsoft 365 Patterns and Practices](https://devofficecdn.azureedge.net/media/Default/PnP/sppnp.png)
![Microsoft 365 Patterns and Practices](https://raw.githubusercontent.com/pnp/media/40e7cd8952a9347ea44e5572bb0e49622a102a12/parker/ms/300w/parker-ms-300.png)

### Applies to ###
- Sharepoint Online
Expand Down
116 changes: 116 additions & 0 deletions build/Build-Debug.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
$versionObject = [System.Version]::new($(Get-Content ..\version.txt -Raw))

$buildVersion = $versionObject.Build + 1;

$version = "$($versionObject.Major).$($versionObject.Minor).$buildVersion"

Write-Host "Building PnP.PowerShell version $version" -ForegroundColor Yellow

dotnet build ../src/Commands/PnP.PowerShell.csproj --nologo --configuration Debug -p:VersionPrefix=$version -p:VersionSuffix=preview

$documentsFolder = [environment]::getfolderpath("mydocuments");

if($IsLinux -or $isMacOS)
{
$destinationFolder = "$documentsFolder/.local/share/powershell/Modules/PnP.PowerShell"
} else {
$destinationFolder = "$documentsFolder/PowerShell/Modules/PnP.PowerShell"
}

$corePath = "$destinationFolder/Core"
$commonPath = "$destinationFolder/Common"
$frameworkPath = "$destinationFolder/Framework"

Try {
# Module folder there?
if(Test-Path $destinationFolder)
{
# Yes, empty it
Remove-Item $destinationFolder\* -Recurse -Force -ErrorAction Stop
}
# No, create it
Write-Host "Creating target folders: $destinationFolder" -ForegroundColor Yellow
New-Item -Path $destinationFolder -ItemType Directory -Force | Out-Null
New-Item -Path "$destinationFolder\Core" -ItemType Directory -Force | Out-Null
New-Item -Path "$destinationFolder\Common" -ItemType Directory -Force | Out-Null
if(!$IsLinux -and !$IsMacOs)
{
New-Item -Path "$destinationFolder\Framework" -ItemType Directory -Force | Out-Null
}

Write-Host "Copying files to $destinationFolder" -ForegroundColor Yellow

$commonFiles = [System.Collections.Generic.Hashset[string]]::new()
Copy-Item -Path "../src/Commands/bin/Debug/netcoreapp3.1/ModuleFiles/*.ps1xml" -Destination "$destinationFolder"
Get-ChildItem -Path "$PSScriptRoot/../src/ALC/bin/Debug/netstandard2.0" | Where-Object {$_.Extension -in '.dll','.pdb' } | Foreach-Object { [void]$commonFiles.Add($_.Name); Copy-Item -LiteralPath $_.FullName -Destination $commonPath }
Get-ChildItem -Path "$PSScriptRoot/../src/Commands/bin/Debug/netcoreapp3.1" | Where-Object {$_.Extension -in '.dll','.pdb' -and -not $commonFiles.Contains($_.Name) } | Foreach-Object { Copy-Item -LiteralPath $_.FullName -Destination $corePath }
if(!$IsLinux -and !$IsMacOs)
{
Get-ChildItem -Path "$PSScriptRoot/../src/Commands/bin/Debug/net461" | Where-Object {$_.Extension -in '.dll','.pdb' -and -not $commonFiles.Contains($_.Name) } | Foreach-Object { Copy-Item -LiteralPath $_.FullName -Destination $frameworkPath }
}
}
Catch
{
Write-Host "Error: Cannot copy files to $destinationFolder. Maybe a PowerShell session is still using the module?"
exit 1
}

Try {
Write-Host "Generating PnP.PowerShell.psd1" -ForegroundColor Yellow
# Load the Module in a new PowerShell session
$scriptBlock = {
$documentsFolder = [environment]::getfolderpath("mydocuments");

if($IsLinux -or $isMacOS)
{
$destinationFolder = "$documentsFolder/.local/share/powershell/Modules/PnP.PowerShell"
} else {
$destinationFolder = "$documentsFolder/PowerShell/Modules/PnP.PowerShell"
}

Import-Module -Name "$destinationFolder/Core/PnP.PowerShell.dll" -DisableNameChecking
$cmdlets = get-command -Module PnP.PowerShell | ForEach-Object{"`"$_`""}
$cmdlets -Join ","
}
$cmdletsString = Start-Job -ScriptBlock $scriptBlock | Receive-Job -Wait

$manifest = "@{
NestedModules = if (`$PSEdition -eq 'Core')
{
'Core/PnP.PowerShell.dll'
}
else
{
'Framework/PnP.PowerShell.dll'
}
ModuleVersion = '$version'
Description = 'Microsoft 365 Patterns and Practices PowerShell Cmdlets'
GUID = '0b0430ce-d799-4f3b-a565-f0dca1f31e17'
Author = 'Microsoft 365 Patterns and Practices'
CompanyName = 'Microsoft 365 Patterns and Practices'
CompatiblePSEditions = @(`"Core`",`"Desktop`")
PowerShellVersion = '5.1'
DefaultCommandPrefix = 'PnP'
DotNetFrameworkVersion = '4.6.1'
ProcessorArchitecture = 'None'
FunctionsToExport = '*'
CmdletsToExport = @($cmdletsString)
VariablesToExport = '*'
AliasesToExport = '*'
FormatsToProcess = 'PnP.PowerShell.Format.ps1xml'
PrivateData = @{
PSData = @{
Prerelease = '-preview'
ProjectUri = 'https://aka.ms/sppnp'
IconUri = 'https://raw.githubusercontent.com/pnp/media/40e7cd8952a9347ea44e5572bb0e49622a102a12/parker/ms/300w/parker-ms-300.png'
}
}
}"
$manifest | Out-File "$destinationFolder/PnP.PowerShell.psd1"
}
Catch
{
Write-Host "Error: Cannot generate PnP.PowerShell.psd1. Maybe a PowerShell session is still using the module?"
exit 1
}

Loading