< Back
New-PSFLicense
Post
NAME New-PSFLicense
SYNOPSIS
Creates a new license object and registers it
SYNTAX
New-PSFLicense [-Product] <String> [[-Manufacturer] <String>] [[-ProductVersion] <Version>] [-ProductType] {Module
| Script | Library | Application | Other} [[-Name] <String>] [[-Version] <Version>] [[-Date] <DateTime>] [[-Type]
{Free | Commercial | NoAttribution | NoModify}] [-Text] <String> [[-Description] <String>] [[-Parent] <License>]
[-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
This function creates a new license object used by the PSFramework licensing component. The license is
automatically registered in the current process' license store.
PARAMETERS
-Product <String>
The product that is being licensed
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Manufacturer <String>
The entity that produced the licensed product
Required? false
Position? 2
Default value ACME ltd.
Accept pipeline input? false
Accept wildcard characters? false
-ProductVersion <Version>
The version of the licensed product
Required? false
Position? 3
Default value 1.0.0.0
Accept pipeline input? false
Accept wildcard characters? false
-ProductType
What kind of product is te license for?
Options: Module, Script, Library, Application, Other
Required? true
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <String>
Most licenses used have a name. Feel free to register that name as well.
Required? false
Position? 5
Default value Unknown
Accept pipeline input? false
Accept wildcard characters? false
-Version <Version>
What version is the license?
Required? false
Position? 6
Default value 1.0.0.0
Accept pipeline input? false
Accept wildcard characters? false
-Date <DateTime>
When was the product licensed with the registered license
Required? false
Position? 7
Default value (Get-Date -Year 1989 -Month 10 -Day 3 -Hour 0 -Minute 0 -Second 0)
Accept pipeline input? false
Accept wildcard characters? false
-Type
Default: Free
This shows the usual limitations that apply to this license. By Default, licenses are considered free and may
be modified, but require attribution when used in your own product.
Required? false
Position? 8
Default value Free
Accept pipeline input? false
Accept wildcard characters? false
-Text <String>
The full text of your license.
Required? true
Position? 9
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Description <String>
A description of the content. Useful when describing how some license is used within your own product.
Required? false
Position? 10
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Parent <License>
The license of the product within which the product of this license is used.
Required? false
Position? 11
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
If this switch is enabled, no actions are performed but informational messages will be displayed that explain
what would happen if the command were to run.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
If this switch is enabled, you will be prompted for confirmation before executing any operations that change
state.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
PSFramework.License.License
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>New-PSFLicense -Product 'Awesome Test Product' -Manufacturer 'Awesome Inc.' -ProductVersion '1.0.1.0'
-ProductType Application -Name FreeBSD -Version "3.0.0.0" -Date (Get-Date -Year 2016 -Month 11 -Day 28 -Hour 0
-Minute 0 -Second 0) -Text @"
Copyright (c) 2016, Awesome Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
"@
This registers the Awesome Test Product as licensed under the common FreeBSD license.
RELATED LINKS
SYNOPSIS
Creates a new license object and registers it
SYNTAX
New-PSFLicense [-Product] <String> [[-Manufacturer] <String>] [[-ProductVersion] <Version>] [-ProductType] {Module
| Script | Library | Application | Other} [[-Name] <String>] [[-Version] <Version>] [[-Date] <DateTime>] [[-Type]
{Free | Commercial | NoAttribution | NoModify}] [-Text] <String> [[-Description] <String>] [[-Parent] <License>]
[-WhatIf] [-Confirm] [<CommonParameters>]
DESCRIPTION
This function creates a new license object used by the PSFramework licensing component. The license is
automatically registered in the current process' license store.
PARAMETERS
-Product <String>
The product that is being licensed
Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Manufacturer <String>
The entity that produced the licensed product
Required? false
Position? 2
Default value ACME ltd.
Accept pipeline input? false
Accept wildcard characters? false
-ProductVersion <Version>
The version of the licensed product
Required? false
Position? 3
Default value 1.0.0.0
Accept pipeline input? false
Accept wildcard characters? false
-ProductType
What kind of product is te license for?
Options: Module, Script, Library, Application, Other
Required? true
Position? 4
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <String>
Most licenses used have a name. Feel free to register that name as well.
Required? false
Position? 5
Default value Unknown
Accept pipeline input? false
Accept wildcard characters? false
-Version <Version>
What version is the license?
Required? false
Position? 6
Default value 1.0.0.0
Accept pipeline input? false
Accept wildcard characters? false
-Date <DateTime>
When was the product licensed with the registered license
Required? false
Position? 7
Default value (Get-Date -Year 1989 -Month 10 -Day 3 -Hour 0 -Minute 0 -Second 0)
Accept pipeline input? false
Accept wildcard characters? false
-Type
Default: Free
This shows the usual limitations that apply to this license. By Default, licenses are considered free and may
be modified, but require attribution when used in your own product.
Required? false
Position? 8
Default value Free
Accept pipeline input? false
Accept wildcard characters? false
-Text <String>
The full text of your license.
Required? true
Position? 9
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Description <String>
A description of the content. Useful when describing how some license is used within your own product.
Required? false
Position? 10
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Parent <License>
The license of the product within which the product of this license is used.
Required? false
Position? 11
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
If this switch is enabled, no actions are performed but informational messages will be displayed that explain
what would happen if the command were to run.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
If this switch is enabled, you will be prompted for confirmation before executing any operations that change
state.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
PSFramework.License.License
-------------------------- EXAMPLE 1 --------------------------
PS C:\\>New-PSFLicense -Product 'Awesome Test Product' -Manufacturer 'Awesome Inc.' -ProductVersion '1.0.1.0'
-ProductType Application -Name FreeBSD -Version "3.0.0.0" -Date (Get-Date -Year 2016 -Month 11 -Day 28 -Hour 0
-Minute 0 -Second 0) -Text @"
Copyright (c) 2016, Awesome Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
"@
This registers the Awesome Test Product as licensed under the common FreeBSD license.
RELATED LINKS