Skip to content

Initialize repository #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
bin/
obj/
project.lock.json
*-tests.xml
/debug/
/staging/
/Packages/
*.nuget.props

# dotnet cli install/uninstall scripts
dotnet-install.ps1
dotnet-install.sh
dotnet-uninstall-pkgs.sh
dotnet-uninstall-debian-packages.sh

# VIM tmp files
*.swp

# VS auto-generated solution files for project.json solutions
*.xproj
*.xproj.user
*.suo

# VS auto-generated files for csproj files
*.csproj.user

# Visual Studio IDE directory
.vs/

# Project Rider IDE files
.idea.powershell/

# Ignore executables
*.exe
*.msi
*.appx

# Ignore binaries and symbols
*.pdb
*.dll

# Ignore packages
*.deb
*.tar.gz
*.zip
*.rpm
*.pkg
*.nupkg
*.AppImage

# ignore the telemetry semaphore file
DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY

# default location for produced nuget packages
/nuget-artifacts

# resgen output
gen

# Per repo profile
.profile.ps1

# macOS
.DS_Store

# TestsResults
TestsResults*.xml

# Resharper settings
PowerShell.sln.DotSettings.user
8 changes: 8 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Code of Conduct

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

[conduct-code]: http://opensource.microsoft.com/codeofconduct/
[conduct-FAQ]: http://opensource.microsoft.com/codeofconduct/faq/
[conduct-email]: mailto:[email protected]
23 changes: 23 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Copyright (c) Microsoft Corporation. All rights reserved.

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the ""Software""), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
70 changes: 70 additions & 0 deletions PowerShellStandard.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
function Start-Build {
$versions = 3,5
$srcBase = Join-Path $PsScriptRoot src
foreach ( $version in $versions ) {
try {
$srcDir = Join-Path $srcBase $version
Push-Location $srcDir
dotnet restore
dotnet build
}
finally {
Pop-Location
}
}
}

function Start-Clean {
$versions = 3,5
$srcBase = Join-Path $PsScriptRoot src
foreach ( $version in $versions ) {
try {
$srcDir = Join-Path $srcBase $version
Push-Location $srcDir
dotnet clean
if ( test-path obj ) { remove-item -recurse -force obj }
if ( test-path bin ) { remove-item -recurse -force bin }
remove-item "PowerShellStandard.Library.${version}*.nupkg"
}
finally {
Pop-Location
}
}
}

function Invoke-Test {
try {
$testBase = Join-Path $PsScriptRoot test
Push-Location $testBase
Invoke-Pester
}
finally {
Pop-Location
}
}

function Export-Nupkg
{
if ( ! (get-command nuget.exe) ) {
Throw "nuget.exe not found, packages cannot be created"
}
# be sure we've built
Start-Build
# build the packages
$versions = 3,5
$srcBase = Join-Path $PsScriptRoot src
foreach ( $version in $versions ) {
try {
$srcDir = Join-Path $srcBase $version
Push-Location $srcDir
$result = nuget.exe pack PowerShellStandard.Library.nuspec 2>&1
if ( ! $? ) {
Write-Error -Message $result
}
}
finally {
Pop-Location
}
}

}
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# PowerShellStandard
# ![logo][] PowerShell Standard

## Supports PowerShell Core and Windows PowerShell

PowerShell Core 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 is a Windows command-line shell designed especially for system administrators.
Windows PowerShell includes an interactive prompt and a scripting environment that can be used independently or in combination.

The PowerShell Standard has been created to assist developers create modules and PowerShell hosts which will use only APIs that exist across different versions of PowerShell.

## PowerShell Standard Libraries

Two PowerShell Standard `.nupkg` versions are available:

- PowerShell Standard.Library Version 3
- This allows you to create PowerShell modules and host which will run on PowerShell Version 3 and later including PowerShellCore

- PowerShell Standard.Library Version 5.1
- This allows you to create PowerShell modules and host which will run on PowerShell Version 5.1 and later including PowerShellCore

[logo]: https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_black_64.png
19 changes: 19 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env pwsh
param (
[Parameter(ParameterSetName="Clean")][switch]$Clean,
[Parameter(ParameterSetName="Test")][switch]$Test
)

import-module $PSScriptRoot/PowerShellStandard.psm1 -force

if ( $Clean ) {
Start-Clean
return
}

Start-Build

if ( $Test ) {
Invoke-Test
}

23 changes: 23 additions & 0 deletions src/3/PowerShellStandard.Library.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>PowerShellStandard.Library</id>
<version>3.0.0-preview-02</version>
<title>PowerShellStandard.Library</title>
<authors>Microsoft</authors>
<owners>Microsoft,PowerShellTeam</owners>
<projectUrl>https://msdn.microsoft.com/en-us/mt173057.aspx</projectUrl>
<iconUrl>https://secure.gravatar.com/avatar/cfba7016de8e12d5b3017130f75ef8ed</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains the reference assemblies for PowerShell Standard 3</description>
<copyright>Copyright Microsoft Corporation 2018. All rights reserved.</copyright>
<tags>PowerShell, netstandard2, netstandard2.0</tags>
<references>
<reference file="System.Management.Automation.dll" />
</references>
</metadata>
<files>
<file src="obj/Debug/netstandard2.0/System.Management.Automation.dll" target="lib/netstandard2.0" />
</files>
</package>

Loading