Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Stores a variable to a Job Resource in the JOC Cockpit inventory item.

SYNTAX

Set-JS7JobResource [-Path] <String> [-Key] <String> [[-Value] <String>] [[-File] <String>] [[-EnvVar] <String>] [-AsString] [-AsNumber] [-AsBoolean] [[-EncryptCertificate] <X509Certificate2>] [[-EncryptCertificatePath] <String>] [[-JavaHome] <String>] [[-JavaLib] <String>] [[-JavaOptions] <String>] [[-AuditComment] <String>] [[-AuditTimeSpent] <Int32>] [[-AuditTicketLink] <Uri>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Variables are A variable is created/updated in a Job Resource. If the Job Resource does not exist, then it will be created.
Values of variables can hold strings, numbers and files. Optionally the values can be encrypted,
for details see https://kb.sos-berlin.com/display/JS7/JS7+-+Encryption+and+Decryption

The following REST Web Service API resources are used:

* /inventory/store

...

-EnvVar <String>
Specifies the name of the environment variable in the Job Resource that holds a reference to the variable.

* Shell jobs access Job Resource variables from environment variables.
* JVM jobs access Job Resource variables directly.

Required?false
Position?5
Default value
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

AsString

-AsString <SwitchParameter>
The value specified for the -Value parameter is considered a string. This similarly applies to numeric values that will be quoted to preserve leading zeroas.

If none of the -AsString, -AsNumber or -AsBoolean parameters is specified then the cmdlet will guess the matching data type from the value specified with the -Value parameter.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

AsNumber

-AsNumber <SwitchParameter>
The value specified for the -Value parameter is considered a number. This includes that leading zeros are removed.

If none of the -AsString, -AsNumber or -AsBoolean parameters is specified then the cmdlet will guess the matching data type from the value specified with the -Value parameter.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

AsBoolean

-AsBoolean <SwitchParameter>
The value specified for the -Value parameter is considered a Boolean. The string values 'true' and 'false' can be specified and the $True and $False built-in PowerShell constants can be used.

If none of the -AsString, -AsNumber or -AsBoolean parameters is specified then the cmdlet will guess the matching data type from the value specified with the -Value parameter.

Required?false
Position?named
Default valueFalse
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

EncryptCertificate

-EncryptCertificate <X509Certificate2>
Specifies that the value of the Job Resource variable should be encrypted using a Certificate object.
Consider that the job that will decrypt the value requires access to the Private Key matching the Certificate.

Certificate objects can be retrieved from a Windows certificate store using the Certificate's thumbprint like this:
$cert = Get-ChildItem cert:\CurrentUser\my | Where { $_.Thumbprint -eq '2B03EA68F103E80D83228ABCF88A3B448CC8B257' }

Only one of the parameters -EncryptCertificate or -EncryptCertificatePath can be used.

Encryption requires use of the -JavaLib parameter that points to the location of JS7 encryption libraries.

...

-JavaHome <String>
Specifies the location to which Java is installed. Java will be required if values should be encrypted using the -certificatePath parameterEncryptCertificate or -EncrypCertificatePath parameters.
If the parameter is not specified then Java will be used from the value of the JAVA_HOME or PATH environment variables.

...

-JavaLib <String>
Specifies the location of the JS7 encryption libraries. The parameter is required if values should be encrypted using the -EncryptCertificate or -certificatePath EncrypCertificatePath parameter.

The libraries ship with Agents and are available from the Agent's <agent-home>/lib directory. For encryption outside of JS7 products the JS7 encryption libraries are available for download.

...

-JavaOptions <String>
Specifies the Java options used when invoking Java for encryption using the -certificatePath EncryptCertificate or -EncrypCertificatePath parameter.
Java options can be used for example to limit memory usage as with -JavaOptions "-Xmx32m".

...

Stores a key and encrypted value to the inventory object of a Job Resource. The -certificatePath EnryptCertificatePath argument specifies the location of the Certificate or Public Key file. The -JavaLib argument specifies the location of the JS7 encryption libraries.

...