<commit_before>function New-EntityBag {
<#
.SYNOPSIS
Creates a EntityBag entry in Appclusive.


.DESCRIPTION
Creates a EntityBag entry in Appclusive.

You must specify the parameters 'Name' and 'Type'. If the entry already exists no update of the existing entry is performed.


.OUTPUTS
default | json | json-pretty | xml | xml-pretty

.EXAMPLE
New-EntityBag -Name "MyName" -Type "MyType"

Type                   : MyType
Value                  :
ManagementCredentialId :
Id                     : 180
Tid                    : 11111111-1111-1111-1111-111111111111
Name                   : MyName
Description            :
CreatedById            : 1
ModifiedById           : 1
Created                : 22.08.2016 10:26:53 +02:00
Modified               : 22.08.2016 10:31:00 +02:00
RowVersion             : {0, 0, 0, 0...}
ManagementCredential   :
Tenant                 :
CreatedBy              :
ModifiedBy             :

Create a new EntityBag entry if it not already exists.


.EXAMPLE
New-KeyNameValue -Name "MyName" -Type "MyType" -Value "MyValue" -Description "MyDescription" -ManagementCredentialId 1

Type                   : MyType
Value                  : MyValue
ManagementCredentialId : 1
Id                     : 180
Tid                    : 11111111-1111-1111-1111-111111111111
Name                   : MyName
Description            : MyDescription
CreatedById            : 1
ModifiedById           : 1
Created                : 22.08.2016 10:26:53 +02:00
Modified               : 22.08.2016 10:31:00 +02:00
RowVersion             : {0, 0, 0, 0...}
ManagementCredential   :
Tenant                 :
CreatedBy              :
ModifiedBy             :

Create a new EntityBag entry if it not already exists, with description, value,...


.LINK
Online Version: http://dfch.biz/biz/dfch/PS/Appclusive/Client/New-EntityBag/
Set-EntityBag: http://dfch.biz/biz/dfch/PS/Appclusive/Client/Set-EntityBag/


.NOTES
See module manifest for dependencies and further requirements.


#>
[CmdletBinding(
    SupportsShouldProcess = $true
	,
    ConfirmImpact = 'Low'
	,
	HelpURI='http://dfch.biz/biz/dfch/PS/Appclusive/Client/New-KeyNameValue/'
)]
Param 
(
	# Specifies the Name to modify
	[Parameter(Mandatory = $true, Position = 0)]
	[ValidateNotNullOrEmpty()]
	[string] $Name
	,
	# Specifies the Value to modify
	[Parameter(Mandatory = $true, Position = 1)]
	[ValidateNotNullOrEmpty()]
	[string] $Value
	,
	# Specifies the value to modify
	[Parameter(Mandatory = $true, Position = 2)]
	[ValidateNotNullOrEmpty()]
	[long] $EntityKindId
	,
	# Specifies the ManagementCredential to modify
	[Parameter(Mandatory = $true, Position = 3)]
	[long] $EntityId
	,
	# Specifies the value to modify
	[Parameter(Mandatory = $false)]
	[long] $ProtectionLevel
	,	
	# Specifies the value to modify
	[Parameter(Mandatory = $false)]
	[string] $Description
	,
	# Service reference to Appclusive
	[Parameter(Mandatory = $false)]
	[Alias('Services')]
	[hashtable] $svc = (Get-Variable -Name $MyInvocation.MyCommand.Module.PrivateData.MODULEVAR -ValueOnly).Services
	,
	# Specifies the return format of the Cmdlet
	[ValidateSet('default', 'json', 'json-pretty', 'xml', 'xml-pretty')]
	[Parameter(Mandatory = $false)]
	[alias('ReturnFormat')]
	[string] $As = 'default'
)

Begin 
{
	trap { Log-Exception $_; break; }

	$datBegin = [datetime]::Now;
	[string] $fn = $MyInvocation.MyCommand.Name;
	Log-Debug -fn $fn -msg ("CALL. svc '{0}'. Name '{1}'." -f ($svc -is [Object]), $Name) -fac 1;

	# Parameter validation<commit_msg>Adjustet description from New-EntityBag.ps1<commit_after>function New-EntityBag {
<#
.SYNOPSIS
Creates a EntityBag entry in Appclusive.


.DESCRIPTION
Creates a EntityBag entry in Appclusive.

You must specify the parameters 'Name', 'Value', 'EntityId' and 'EntityKindId'. If the entry already exists no update of the existing entry is performed.


.OUTPUTS
default | json | json-pretty | xml | xml-pretty

.EXAMPLE
New-EntityBag -Name "ArbitraryName" -Value "ArbitraryValue" -EntityId 2 -EntityKindId 1 -svc $svc

Name            : ArbitraryName
Value           : ArbitraryValue
EntityId        : 2
EntityKindId    : 1
ProtectionLevel : 0
Id              : 159
Tid             : 11111111-1111-1111-1111-111111111111
Description     :
CreatedById     : 1
ModifiedById    : 1
Created         : 23.08.2016 11:08:14 +02:00
Modified        : 23.08.2016 11:08:14 +02:00
RowVersion      : {0, 0, 0, 0...}
Tenant          :
CreatedBy       :
ModifiedBy      :

Create a new EntityBag entry if it not already exists.


.EXAMPLE
New-EntityBag -Name "ArbitraryName" -Value "ArbitraryValue" -EntityId 2 -EntityKindId 1 -svc $svc -Description "ArbitraryDescription" -ProtectionLevel 1

Name            : ArbitraryName
Value           : ArbitraryValue
EntityId        : 2
EntityKindId    : 1
ProtectionLevel : 1
Id              : 159
Tid             : 11111111-1111-1111-1111-111111111111
Description     : ArbitraryDescription
CreatedById     : 1
ModifiedById    : 1
Created         : 23.08.2016 11:08:14 +02:00
Modified        : 23.08.2016 11:08:14 +02:00
RowVersion      : {0, 0, 0, 0...}
Tenant          :
CreatedBy       :
ModifiedBy      :

Create a new EntityBag entry if it not already exists, with description and protectionLevel...


.LINK
Online Version: http://dfch.biz/biz/dfch/PS/Appclusive/Client/New-EntityBag/
Set-EntityBag: http://dfch.biz/biz/dfch/PS/Appclusive/Client/Set-EntityBag/


.NOTES
See module manifest for dependencies and further requirements.


#>
[CmdletBinding(
    SupportsShouldProcess = $true
	,
    ConfirmImpact = 'Low'
	,
	HelpURI='http://dfch.biz/biz/dfch/PS/Appclusive/Client/New-KeyNameValue/'
)]
Param 
(
	# Specifies the Name to modify
	[Parameter(Mandatory = $true, Position = 0)]
	[ValidateNotNullOrEmpty()]
	[string] $Name
	,
	# Specifies the Value to modify
	[Parameter(Mandatory = $true, Position = 1)]
	[ValidateNotNullOrEmpty()]
	[string] $Value
	,
	# Specifies the EntityKindId to modify
	[Parameter(Mandatory = $true, Position = 2)]
	[ValidateNotNullOrEmpty()]
	[long] $EntityKindId
	,
	# Specifies the EntityId to modify
	[Parameter(Mandatory = $true, Position = 3)]
	[long] $EntityId
	,
	# Specifies the ProtectionLevel to modify
	[Parameter(Mandatory = $false)]
	[long] $ProtectionLevel
	,	
	# Specifies the Description to modify
	[Parameter(Mandatory = $false)]
	[string] $Description
	,
	# Service reference to Appclusive
	[Parameter(Mandatory = $false)]
	[Alias('Services')]
	[hashtable] $svc = (Get-Variable -Name $MyInvocation.MyCommand.Module.PrivateData.MODULEVAR -ValueOnly).Services
	,
	# Specifies the return format of the Cmdlet
	[ValidateSet('default', 'json', 'json-pretty', 'xml', 'xml-pretty')]
	[Parameter(Mandatory = $false)]
	[alias('ReturnFormat')]
	[string] $As = 'default'
)

Begin 
{
	trap { Log-Exception $_; break; }

	$datBegin = [datetime]::Now;
	[string] $fn = $MyInvocation.MyCommand.Name;
	Log-Debug -fn $fn -msg ("CALL. svc '{0}'. Name '{1}'." -f ($svc -is [Object]), $Name) -fac 1;

	# Parameter validation
{'fraction_non_alphanumeric': 0.1165257273899957, 'fraction_numerical': 0.0481582341980794, 'mean_word_length': 2.9246344206974126, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 8, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5750633', 'n_tokens_mistral': 2540, 'n_tokens_neox': 2238, 'n_words': 611}