Replaces Add-Content with neo42 encoding handling for files.
# ParameterSet Path
Add-NXTContent
[-Path] <string[]>
[-Value] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-PassThru]
[-NoNewLine]
[-Force]
[-Encoding <Encoding>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Add-NXTContent
[-Value] <string[]>
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-PassThru]
[-NoNewLine]
[-Force]
[-Encoding <Encoding>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
It's use is limited to only files and it will determine the encoding of the file and use that if no encoding is specified.
Should the detection fail, or if the file doesn't exist, it will use the encoding defined in the DefaultEncoding parameter.
Important note: If the file exists and the encoding is specified, the encoding will not be updated. Only the new content will be written with the specified encoding.
Add-NXTContent -Path 'C:\Temp\test.txt' -Value 'Hello World'
Adds the content 'Hello World' to the file 'C:\Temp\test.txt'.
Add-NXTContent -Path 'C:\Temp\test.txt' -Value 'Hello World' -Encoding UTF8
Adds the content 'Hello World' to the file 'C:\Temp\test.txt' using the UTF8 encoding. If the file exists, only the new content will be written with the specified encoding.
System.String - The content to add to the file(s).
System.IO.FileInfo - The file(s) to add content to.
System.String - The content that was added to the file(s) if the -PassThru parameter is specified.
The path to the file(s) to add content to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the file(s) to add content to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The content to add to the file(s).
| Property | Value |
|---|---|
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
Returns the content added to the file(s) if specified.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Do not append a newline character to the content.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if the Read-Only attribute should be ignored when setting the content of the file or hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when the file is created. If the file exists, the encoding will not be updated.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Add a custom hook that is run after a specific custom function.
Add-NXTDeploymentCallback
[-Callback] <CommandInfo[]>
[[-HookPoint] <DeploymentHookPoint[]>]
[-Prepend]
[<CommonParameters>]
The Add-NXTDeploymentCallback function adds a custom hook to the deployment session that is executed after the specified deployment hook point.
Add-NXTDeploymentCallback -HookPoint 'CustomInstallEnd' -Callback (Get-Command -Name 'My-CustomFunction')
This example adds a custom hook that executes the 'My-CustomFunction' function after the 'CustomInstallEnd' deployment hook point.
This function does not take any pipeline input.
This function does not return any output.
The command information object representing the custom function to be executed as a hook.
| Property | Value |
|---|---|
| Type: | CommandInfo |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the deployment hook point after which the custom hook should be executed.
If this parameter is omitted, the name of the callback will be used to determine the hook point.
| Property | Value |
|---|---|
| Type: | DeploymentHookPoint |
| Enum values: | CustomBegin, CustomInstallAndReinstallAndSoftMigrationBegin, CustomSoftMigrationBegin, CustomSoftMigrationEnd, CustomInstallAndReinstallAndSoftMigrationEnd, CustomInstallAndReinstallPreInstallAndReinstall, CustomReinstallPreUninstall, CustomReinstallPostUninstallOnError, CustomReinstallPostUninstall, CustomReinstallPreInstall, CustomReinstallPostInstallOnError, CustomReinstallPostInstall, CustomInstallBegin, CustomInstallEndOnError, CustomInstallEnd, CustomInstallAndReinstallEnd, CustomUninstallBegin, CustomUninstallEndOnError, CustomUninstallEnd, CustomInstallUserPartBegin, CustomInstallUserPartEnd, CustomUninstallUserPartBegin, CustomUninstallUserPartEnd, CustomEnd, CustomEndOnError |
| Position: | 1 |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Add the hook to the to of the list.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Adds access control permissions on a specified, existing folder without removing existing permissions.
# ParameterSet Path
Add-NXTFolderPermission
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-FullControl <IdentityReference[]>]
[-Write <IdentityReference[]>]
[-Modify <IdentityReference[]>]
[-ReadAndExecute <IdentityReference[]>]
[-Recurse]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Add-NXTFolderPermission
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-FullControl <IdentityReference[]>]
[-Write <IdentityReference[]>]
[-Modify <IdentityReference[]>]
[-ReadAndExecute <IdentityReference[]>]
[-Recurse]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The function allows granular control over the access permissions of a specified folder.
It can assign specific permission levels (e.g., Full Control, Modify, Write, Read & Execute) to identity references (SID, user name or group name).
The function also provides options to set the owner, manage custom directory security settings, and control the inheritance of permissions.
It is capable of applying these settings to both the target folder and its sub-folders.
Add-NXTFolderPermission -Path 'C:\Temp\MyFolder' -FullControl 'DOMAIN\User1', 'BuiltinAdministratorsSid' -Write 'S-1-1-0' -Owner 'DOMAIN\User1'
Add permissions to folder 'C:\Temp\MyFolder' granting full control permissions for 'DOMAIN\User1' and 'Administrators', write permissions for 'Everyone'.
System.String - The path to the folder(s) to set permissions on.
System.IO.DirectoryInfo - The folder(s) to set permissions on.
This function does not return any output.
The path to the folder(s) to add permissions to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the folder(s) to add permissions to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The user(s) or group(s) to grant full control permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant write permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant modify permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant read and execute permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that the permissions should be applied to all sub-folders of the specified folder.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Extends the PATH environment variable.
Add-NXTPathVariable
[-Path] <string[]>
[-Prepend]
[-Target <EnvironmentVariableTarget>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Extends the PATH environment variable of a specified target with the given path(s).
If the path already exists, it will not be added again. Empty values will be removed.
Add-NXTPathVariable -Path 'C:\Program Files\Example\bin'
Adds the path 'C:\Program Files\Example\bin' to the machine PATH variable.
Add-NXTPathVariable -Path 'C:\Program Files\Example\bin' -Prepend -Target Process
Adds the path 'C:\Program Files\Example\bin' to the process PATH variable at the beginning.
System.String - The path(s) to add to the PATH variable.
System.IO.DirectoryInfo - The path(s) to add to the PATH variable.
This function does not return any output.
The path(s) to add to the PATH variable.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
When specified, the path will be added at the beginning of the PATH variable.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines the scope of the PATH variable to be modified.
| Property | Value |
|---|---|
| Type: | EnvironmentVariableTarget |
| Enum values: | Process, User, Machine |
| Position: | Named |
| Default value: | Machine |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Adds a new node to an existing xml node.
# ParameterSet Path
Add-NXTXmlNode
[-Path] <string[]>
-XPath <string>
-Name <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Attributes <hashtable>]
[-InnerText <string>]
[-PassThru]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Add-NXTXmlNode
-LiteralPath <string[]>
-XPath <string>
-Name <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Attributes <hashtable>]
[-InnerText <string>]
[-PassThru]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet Xml
Add-NXTXmlNode
-XPath <string>
-Name <string>
[-InputObject <XmlNode[]>]
[-Attributes <hashtable>]
[-InnerText <string>]
[-PassThru]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Adds a new node to an existing xml node. The node is added at the specified XPath location.
The XPath must point to a single node. The new node will be added as a child node of the specified node.
Add-NXTXmlNode -Path 'C:\Temp\test.xml' -XPath '/root/parent' -Name 'child' -Attributes @{ attr1 = 'value1'; attr2 = 'value2' } -InnerText 'Hello World'
Adds a new node 'child' to the XML document 'C:\Temp\test.xml' at the XPath location '/root/parent'.
System.Xml.XmlNode - The XML node(s) or XML document(s) to add the new node to.
System.IO.FileInfo - The XML file(s) to add the new node to.
System.Xml.XmlNode - The XML node(s) or document(s) that were modified if the -PassThru parameter is specified.
The path to the XML file(s) to add the node to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the XML file(s) to add the node to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when the file is created. If the file exists, the encoding will not be updated.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The XML node(s) to add the new node to.
| Property | Value |
|---|---|
| Type: | XmlNode |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The XPath to the node to add the new node to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the new node to add.
The name can contain a namespace prefix (e.g. 'ns:nodeName') if the node is in a namespace. The namespace prefix must be defined in the XML document.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A hashtable of attributes to set on the new node.
The keys can contain a namespace prefix (e.g. 'ns:attrName') if the attribute is in a namespace. The namespace prefix must be defined in the XML document.
| Property | Value |
|---|---|
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The inner text to set on the new node.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Returns the XML document if specified.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if the Read-Only attribute should be ignored when setting the content of the file or hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Clears all custom hooks.
Clear-NXTDeploymentCallback
[-HookPoint] <DeploymentHookPoint[]>
[<CommonParameters>]
The Clear-NXTDeploymentCallback function removes a custom hook from the deployment session that was previously added with Add-NXTDeploymentCallback.
Add-NXTDeploymentCallback -HookPoint 'CustomInstallEnd' -Callback (Get-Command -Name 'My-CustomFunction')
This example adds a custom hook that executes the 'My-CustomFunction' function after the 'CustomInstallEnd' deployment hook point.
This function does not take any pipeline input.
This function does not return any output.
The name of the deployment hook point after which the custom hook should be executed.
| Property | Value |
|---|---|
| Type: | DeploymentHookPoint |
| Enum values: | CustomBegin, CustomInstallAndReinstallAndSoftMigrationBegin, CustomSoftMigrationBegin, CustomSoftMigrationEnd, CustomInstallAndReinstallAndSoftMigrationEnd, CustomInstallAndReinstallPreInstallAndReinstall, CustomReinstallPreUninstall, CustomReinstallPostUninstallOnError, CustomReinstallPostUninstall, CustomReinstallPreInstall, CustomReinstallPostInstallOnError, CustomReinstallPostInstall, CustomInstallBegin, CustomInstallEndOnError, CustomInstallEnd, CustomInstallAndReinstallEnd, CustomUninstallBegin, CustomUninstallEndOnError, CustomUninstallEnd, CustomInstallUserPartBegin, CustomInstallUserPartEnd, CustomUninstallUserPartBegin, CustomUninstallUserPartEnd, CustomEnd, CustomEndOnError |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Compare two versions with extended support for different version formats.
Compare-NXTVersion
[-Version] <string>
[-Target] <string>
[<CommonParameters>]
Compare two versions using the PSADTNXT.Application.NxtVersion class, which supports a wide range of version formats.
Known formats include:
1.2.31.2a1.2-prerelease+buildv1.21.2 (build 123)2025-01-01Compare-NXTVersion -Version '1.2.3.4' -Target '4.3.2.1'
Will return PSADTNXT.Application.VersionCompareResult::Update.
System.String - The base version to compare.
PSADTNXT.Application.VersionCompareResult - The result of the comparison.
The version to compare.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
The target version to compare against.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Converts an escaped string into a list of components.
ConvertFrom-NXTCommandLine
[-InputObject] <string>
[<CommonParameters>]
Interprets the input string as a command line, and returns an array of strings that represent the command line components.
ConvertFrom-NXTCommandLine -InputObject '"C:\my program.exe" -Argument1 "Value 1" -Argument2 '''Value 2''''
This will return an array of strings: 'C:\my program.exe', '-Argument1', 'Value 1', '-Argument2', 'Value 2'.
System.String - The escaped string that should be convert into a list of components.
PSADTNXT.Package.NxtRegisteredPackage - A registered package for which to retrieve the uninstall arguments.
PSADT.Types.InstalledApplication - An installed application for which to retrieve the uninstall arguments.
System.String - An array of strings that represent the command line components.
The escaped string that you want to convert into a list of components.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
Converts a Base64-encoded and compressed object string into a PowerShell object.
ConvertFrom-NXTEncodedObject
[-InputObject] <string>
[-AsHashTable]
[<CommonParameters>]
Deserializes a given Base64-encoded and compressed string back into its original type.
"eJyzVnLPLEvN80vMTVWyUvLKz8hT0lEKLi2CCrjkpyrV6qAq8k2sQFHjW1pcklqUm5iXp1QbCwCmtj3M" | ConvertFrom-NXTEncodedObject
This example demonstrates how to decode a Base64-encoded and compressed string into a object.
System.String - The Base64-encoded and compressed string to decode.
System.Object - The deserialized object.
The Base64-encoded and compressed string to decode.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
When specified, the output object will be converted to a hashtable instead of a PSCustomObject.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Converts a JSON string to a custom object.
ConvertFrom-NXTJson
[-InputObject] <string>
[-AsHashtable]
[<CommonParameters>]
The ConvertFrom-NXTJson function converts a JSON string to a custom object.
It enables the feature set of PowerShell Core's Cmdlet in Windows PowerShell 5.1 (json with comments and -AsHashtable parameter).
'{"key": "value"}' | ConvertFrom-NXTJson
This will return a custom object with the key 'key' and the value 'value'.
System.String - The JSON string to convert.
System.Management.Automation.PSObject - The custom object created from the JSON string.
System.Collections.Hashtable - The custom object created from the JSON string if the -AsHashtable parameter is specified.
The JSON string to convert.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
When specified, the function will return a hashtable instead of a custom object.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Converts an installer product code into a product GUID.
ConvertFrom-NXTProductCode
[-ProductCode] <string>
[<CommonParameters>]
Converts an installer product code into a product GUID.
"74A40E43AE252A33DA9C28656E1F4E10" | ConvertFrom-NXTProductCode
Converts the installer product code into a product GUID.
System.String - The installer product code to convert.
System.Guid - The product GUID.
The installer product code that you want to convert into a product GUID.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
Converts a object into a Base64-encoded and compressed json string.
ConvertTo-NXTEncodedObject
[-InputObject] <Object>
[-Depth <uint16>]
[<CommonParameters>]
The ConvertTo-NxtEncodedObject function takes an object as input and performs three main operations:
@{ Name = 'Jane'; Details = @{ Age = 25; Occupation = 'Engineer' } } | ConvertTo-NXTEncodedObject
This example demonstrates how to convert a nested object into a Base64-encoded and compressed string.
System.Object - The object to convert.
System.String - The Base64-encoded and compressed string representation of the object.
The object to convert.
| Property | Value |
|---|---|
| Type: | Object |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The maximum depth of the object to serialize.
| Property | Value |
|---|---|
| Type: | UInt16 |
| Position: | Named |
| Default value: | 2 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Converts a product GUID into an installer product code.
ConvertTo-NXTInstallerProductCode
[-Guid] <guid>
[<CommonParameters>]
Converts a product GUID into an installer product code.
"{12345678-1234-1234-1234-123456789012}" | ConvertTo-NxtInstallerProductCode
Converts the product GUID into an installer product code.
System.Guid - The product GUID to convert.
System.String - The installer product code.
The product GUID that you want to convert into an installer product code.
| Property | Value |
|---|---|
| Type: | Guid |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
Converts a product GUID into an installer product code.
ConvertTo-NXTProductCode
[-Guid] <guid>
[<CommonParameters>]
Converts a product GUID into an installer product code.
"{12345678-1234-1234-1234-123456789012}" | ConvertTo-NXTProductCode
Converts the product GUID into an installer product code.
System.Guid - The product GUID to convert.
System.String - The installer product code.
The product GUID that you want to convert into an installer product code.
| Property | Value |
|---|---|
| Type: | Guid |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
Converts a dictionary object to an argument list.
ConvertTo-NXTPsArgumentString
[-InputObject] <hashtable>
[-StringDelimiter <string>]
[-StringDelimiterReplacement <string>]
[-UseEnumValue]
[<CommonParameters>]
Converts a dictionary object to an argument list. The dictionary keys are used as the parameter names and the values are used as the parameter values.
Be aware that only types that can be converted from and to a string are supported.
Additionally, switch and boolean values are supported.
@{ 'Key1' = 'Value1'; 'Key2' = 'Value2' } | ConvertTo-NXTPsArgumentString
Will return a argument string with named parameters: -Key1 "Value1" -Key2 "Value2".
@{ 1 = 'Value1'; 2 = 'Value2' } | ConvertTo-NXTPsArgumentString
Will return a argument string with positional parameters: "Value1" "Value2".
System.Collections.Hashtable - The dictionary object to convert.
System.Management.Automation.InvocationInfo - The bound parameters of the current command.
System.String - The argument list.
The dictionary object to convert. If the keys are integers, they will be treated as positional parameters, otherwise they will be treated as named parameters.
| Property | Value |
|---|---|
| Type: | Hashtable |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The string delimiter to use if the string value contains tokens that need to be escaped.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | " |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The replacement string for string delimiters within the string value.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | StringDelimiter's default escape replacement. |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Use the enum value instead of the enum name.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
This a helper function that allows ending the deployment process.
# ParameterSet ExitCode
Exit-NXTDeployment
[-Message] <string>
[[-ExitCode] <int>]
[-ADTSession <NxtDeploymentSession>]
[-NoRegistration]
[<CommonParameters>]
# ParameterSet Status
Exit-NXTDeployment
[[-Message] <string>]
-Status <DeploymentStatus>
[-ADTSession <NxtDeploymentSession>]
[-NoRegistration]
[<CommonParameters>]
# ParameterSet AbortReboot
Exit-NXTDeployment
[[-Message] <string>]
-AbortReboot
[-ADTSession <NxtDeploymentSession>]
[<CommonParameters>]
This a helper function that allows ending the deployment process by throwing a NxtDeploymentCancelException.
The exception is caught by the Invoke-NXTDeployment function and the deployment process will be ended.
Exit-NXTDeployment -Message "Deployment should stop here. No error was reported." -ExitCode 0
This will halt the deployment process and will only run post-deployment tasks.
Exit-NXTDeployment -Status 'Error'
This will halt the deployment process and will only run post-deployment tasks and mark the deployment as failed.
This function does not take any pipeline input.
This function does not return any output.
The deployment session object representing the current deployment.
| Property | Value |
|---|---|
| Type: | NxtDeploymentSession |
| Position: | Named |
| Default value: | (& $script:CommandTable.'Get-ADTSession') |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The message to be displayed in the exception.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The exit code to set for the deployment session.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | 1 |
| Default value: | 0 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Apply a predefined exit code and message representing the given status.
| Property | Value |
|---|---|
| Type: | DeploymentStatus |
| Enum values: | Complete, RestartRequired, FastRetry, Error |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A quick access switch to set the exit code to 3010, NoRegistration to true and a predefined message.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Will set the Register property of the package to false.
Additionally if the package is registered, it will be unregistered.
This is useful for requiring a restart of the system before the package is considered deployed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Expands different variable types in a given text file.
# ParameterSet Path
Expand-NXTVariablesInFile
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Expand-NXTVariablesInFile
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Designed to expand a variety of variable types present in a text file.
The function is equipped to handle Windows style environment variables, PowerShell variables and PowerShell subexpression operators.
Upon execution, the function will update the target file by replacing all variable references with their actual values.
The file does not need to be a PowerShell script, but the function will only expand variables that are valid in PowerShell.
Expand-NXTVariablesInFile -Path 'C:\Temp\test.txt' -Variables @(Get-Variable 'MyVar1', 'MyVar2')
Expands the variables in the file 'C:\Temp\test.txt' using the values of the PowerShell variables 'MyVar1' and 'MyVar2'.
System.String - The path to the file(s) to expand variables in.
This function does not return any output.
The path to the file(s) to expand variables in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the file(s) to expand variables in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The encoding to use when the file is created.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if the Read-Only attribute should be ignored when setting the content of the file or hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Retrieves the application matching the application search criteria.
# ParameterSet Manual
Get-NXTApplication
[-Store <ApplicationStore>]
[-Identifier <string>]
[-Name <string>]
[-NamePattern <StringCompareOperator>]
[-Filter <scriptblock>]
[<CommonParameters>]
# ParameterSet Criteria
Get-NXTApplication
[-Criteria] <NxtApplicationCriteria>
[<CommonParameters>]
Retrieves the application matching the application search criteria.
The function queries the specified application store for entries matching the identifier and applies an optional filter to find the desired application(s).
If no Identifier is provided, all applications from the specified store are returned and filtered accordingly.
Get-NXTApplication -Criteria @{ Store = 'ARP'; Identifier = 'TestApp' }
Retrieves the application from the ARP store with an identifier of 'TestApp'.
Get-NXTApplication -Store 'ARP' -Filter { $_.DisplayVersion -like '1.*' }
Retrieves all applications from the ARP store with a display version starting with '1.'.
Get-NXTApplication -Name 'MyApp' -NamePattern 'Contains'
Retrieves all ARP applications that contain 'MyApp' in their name.
This function does not take any pipeline input.
[PSADT.Types.InstalledApplication]
The application search criteria used to find the application(s).
| Property | Value |
|---|---|
| Type: | NxtApplicationCriteria |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The application store to query for applications. This parameter is used when the Criteria parameter set is not used.
| Property | Value |
|---|---|
| Type: | ApplicationStore |
| Enum values: | Package, ARP, ARP32, ARP64, AppX |
| Position: | Named |
| Default value: | PSADTNXT.Application.ApplicationStore::ARP |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The identifier to search for in the specified store. This parameter is used when the Criteria parameter set is not used.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Filter for a specific name of an application based on NamePattern detection.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The string pattern to use with the name parameter.
| Property | Value |
|---|---|
| Type: | StringCompareOperator |
| Enum values: | Equals, Contains, StartsWith, EndsWith, Wildcard, Regex |
| Position: | Named |
| Default value: | Equals |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
An optional script block used to filter the retrieved applications. The script block should return $true for the desired application(s). This parameter is used when the Criteria parameter set is not used.
| Property | Value |
|---|---|
| Type: | ScriptBlock |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Retrieves the complete command table of this module.
Get-NXTCommandTable
This command table includes the base PSADT command table and functions from the current module.
This function does not take any pipeline input.
[System.Collections.ObjectModel.ReadOnlyDictionary2System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089,System.Management.Automation.CommandInfo, System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]`
This function does not have any documented parameters.
Replaces Get-Content with neo42 encoding handling for files.
# ParameterSet Path
Get-NXTContent
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Force]
[-Encoding <Encoding>]
[<CommonParameters>]
# ParameterSet LiteralPath
Get-NXTContent
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Force]
[-Encoding <Encoding>]
[<CommonParameters>]
It's use is limited to only files and it will determine the encoding of the file and use that if no encoding is specified.
Should the detection fail, or if the file doesn't exist, it will use the encoding defined in the DefaultEncoding parameter.
Get-NXTContent -Path 'C:\Temp\test.txt'
Gets the content of the file 'C:\Temp\test.txt'.
Get-NXTContent -Path 'C:\Temp\test.txt' -Encoding UTF8
Gets the content of the file 'C:\Temp\test.txt' using the UTF8 encoding.
System.IO.FileInfo - The file(s) to get content from.
System.String - The content of the file(s).
The path to the file(s) to get content from.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the file(s) to get content from.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
Determines if hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to read the file with. If not specified, the encoding will be detected from the file.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Retrieves the free space in a given unit.
Get-NXTDriveFreeSpace
[-Name] <string>
[[-Unit] <DataSizeUnit>]
[<CommonParameters>]
Retrieves the free space in a given unit. The default unit is bytes.
If the drive is not mounted, or the drive name is invalid, an error will be thrown.
NOTE
The output is rounded down to the nearest whole number.
Get-NxtDriveFreeSpace -DriveName "C:"
This example retrieves the free space of the C: drive in bytes.
Get-NxtDriveFreeSpace -DriveName "D" -Unit "GB"
This example retrieves the free space of the D: drive in gigabytes.
Get-PSDrive C | Get-NxtDriveFreeSpace -Unit "GB"
This example retrieves the type of the C: drive using the PSProvider and converts the output to gigabytes.
System.String - The drive letter or ID of the drive to check.
System.Management.Automation.PSDriveInfo - The PSDriveInfo object to check.
Microsoft.Management.Infrastructure.CimInstance - The MSFT_Volume cim instance to check.
System.UInt64 - The free space in the specified unit.
A string representing the drive letter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The output unit size. The default is bytes.
| Property | Value |
|---|---|
| Type: | DataSizeUnit |
| Enum values: | B, KB, MB, GB, TB, PB |
| Position: | 1 |
| Default value: | PSADTNXT.IO.DataSizeUnit::B |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Retrieves the drive type of a given drive.
Get-NXTDriveType
[-Name] <string>
[<CommonParameters>]
The Get-NxtDriveType function determines the type of a given drive.
If an invalid drive name is provided, it will throw an error. If the drive is not mounted, NoRootDirectory will be returned.
Get-NXTDriveType -Name "C:"
This example retrieves the type of the C: drive.
Get-PSDrive C | Get-NXTDriveType
This example retrieves the type of the C: drive using the PSProvider.
Get-Volume -DriveLetter C | Get-NXTDriveType
This example retrieves the type of the C: drive using the Get-Volume cmdlet (uses CimInstance).
System.String - The drive letter or ID of the drive to check.
System.Management.Automation.PSDriveInfo - The PSDriveInfo object to check.
Microsoft.Management.Infrastructure.CimInstance - The MSFT_Volume cim instance to check.
System.IO.DriveType - The type of the drive.
A string representing the drive letter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Gets the estimated encoding of a file based on BOM and other heuristics.
# ParameterSet Path
Get-NXTFileEncoding
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Force]
[-DefaultEncoding <Encoding>]
[<CommonParameters>]
# ParameterSet LiteralPath
Get-NXTFileEncoding
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Force]
[-DefaultEncoding <Encoding>]
[<CommonParameters>]
The Get-NxtFileEncoding function returns the estimated encoding of a file based on the presence of a Byte Order Mark (BOM) and other heuristics.
If the encoding cant be detected, it will default to the provided DefaultEncoding.
Get-NXTFileEncoding -Path 'C:\Temp\test.txt'
Gets the estimated encoding of the file 'C:\Temp\test.txt'.
System.String - The path to the file to check for encoding.
System.IO.FileInfo - The file to check for encoding.
System.Text.Encoding - The estimated encoding of the file.
The path to the file(s) to check for encoding.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the file(s) to check for encoding.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
Determines if hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The default encoding to use if the file does not exist or if the encoding cannot be detected.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | $OutputEncoding - Will use the caller's OutputEncoding. |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Retrieves the size of the specified folder recursively, in the given unit.
# ParameterSet Path
Get-NXTFolderSize
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Unit <DataSizeUnit>]
[<CommonParameters>]
# ParameterSet LiteralPath
Get-NXTFolderSize
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Unit <DataSizeUnit>]
[<CommonParameters>]
The Get-NxtFolderSize function calculates the size of the specified folder, including all of its sub folders and files.
It supports various units for the output size, such as bytes, kilobytes, megabytes, gigabytes, and terabytes.
Get-NxtFolderSize "D:\setup\"
Retrieves the size of the folder located at "D:\setup" in bytes.
Get-NxtFolderSize "C:\Users\User\Documents" -Unit "MB"
Retrieves the size of the folder located at "C:\Users\User\Documents" in megabytes.
System.String - The path to the folder(s) to calculate the size of.
System.IO.DirectoryInfo - The folder(s) to calculate the size of.
System.UInt64 - The size of the folder(s) in the specified unit.
Specifies the path to the folder(s) to calculate the size of. Wildcards are supported.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
Specifies the literal path to the folder(s) to calculate the size of.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
Retrieves the parent process of a given process ID.
Get-NXTParentProcess
[[-Id] <int>]
[-Recurse]
[-Depth <uint16>]
[<CommonParameters>]
Retrieves the parent process(es) of a given process ID in order.
It can optionally retrieve the entire parent hierarchy by using the -Recurse switch.
Get-NXTParentProcess -Id 1234
Retrieves the parent process of the process with ID 1234.
Get-NXTParentProcess -Id 1234 -Recurse -Depth 5
Retrieves the parent process hierarchy of the process with ID 1234, up to a depth of 5.
System.Int32 - The process ID to check.
System.Diagnostics.Process - The process to check.
Microsoft.Management.Infrastructure.CimInstance - The Win32_Process cim instance to check.
System.Diagnostics.Process - The parent process(es) of the specified process ID.
The process ID of the child process.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | 0 |
| Default value: | $PID |
| Required: | False |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
Recursively retrieves the parent process hierarchy.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The maximum number of parent processes to retrieve.
| Property | Value |
|---|---|
| Type: | UInt16 |
| Position: | Named |
| Default value: | 20 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Get the process tree for a given process ID
Get-NXTProcessTree
[[-Id] <int>]
[-NoChildren]
[-NoParents]
[-Depth <uint16>]
[<CommonParameters>]
It retrieves the parent process(es) and child process(es) of the specified process ID in order.
`Get-NXTProcessTree -Id 1234`
Retrieves the process tree for the process with ID 1234.
Get-NXTProcessTree -Id 1234 -NoParents -Depth 1
Retrieves the child processes of the process with ID 1234, without retrieving parent processes.
System.Int32 - The process ID to check.
System.Diagnostics.Process - The process to check.
Microsoft.Management.Infrastructure.CimInstance - The Win32_Process cim instance to check.
System.Diagnostics.Process - The process tree for the specified process ID.
The process ID of the process to get the tree for.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | 0 |
| Default value: | $PID |
| Required: | False |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
When specified, the function will not retrieve child processes.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
When specified, the function will not retrieve parent processes.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The maximum number of child processes and parent processes to retrieve.
The value applies to both child and parent processes separately.
| Property | Value |
|---|---|
| Type: | UInt16 |
| Position: | Named |
| Default value: | 20 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Retrieves information about NXT registered packages on the current machine.
# ParameterSet Filter
Get-NXTRegisteredPackage
[-PackageId <guid>]
[-Installed <bool>]
[-Exclude <guid[]>]
[-RegistryKeyName <string>]
[<CommonParameters>]
# ParameterSet Application
Get-NXTRegisteredPackage
-Application <InstalledApplication>
[<CommonParameters>]
# ParameterSet Session
Get-NXTRegisteredPackage
[-ADTSession <NxtDeploymentSession>]
[<CommonParameters>]
Gets details of the registered application packages installed on a local machine.
The function fetches details such as PackageGUID and InstallState.
Get-NXTRegisteredPackage -PackageId "{12345678-1234-1234-1234-123456789012}" -Installed $false
This example retrieves information about a specific package that is registered but not installed.
Get-NXTRegisteredPackage -RegistryKeyName neoPackages -PackageId "{12345678-1234-1234-1234-123456789012}"
This example retrieves information about a specific package that is registered under the "neoPackages" registry key.
This does not rely on the uninstall key back reference being present, so it can be used to get information about packages that are registered but not installed.
This function does not take any pipeline input.
PSADTNXT.Package.NxtRegisteredPackage - An array of NxtRegisteredPackage objects.
Filters the results based on the specified package ID.
| Property | Value |
|---|---|
| Type: | Guid |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Filters the results based on the installation state of the package.
| Property | Value |
|---|---|
| Type: | Boolean |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Excludes the specified package IDs from the results.
| Property | Value |
|---|---|
| Type: | Guid |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Filters the results based on the specified registry packages key.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Gets the package related to the specified InstalledApplication object.
| Property | Value |
|---|---|
| Type: | InstalledApplication |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
Gets the package related to the specified NxtDeploymentSession object.
| Property | Value |
|---|---|
| Type: | NxtDeploymentSession |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Returns the currently applied strict mode version.
Get-NXTStrictMode
[<CommonParameters>]
Returns the currently applied strict mode version.
NOTE
This function tries to determine the currently applied strict mode version by causing an error in each version.
Currently the maximum supported version is 3. If a higher version is released, this function will need to be updated.
Get-NXTStrictMode
Returns the currently applied strict mode version as a System.Version object.
This function does not take any pipeline input.
System.Version or $null
This function does not have any documented parameters.
Retrieve nodes from an existing XML document.
# ParameterSet Path
Get-NXTXmlNode
[-Path] <string[]>
-XPath <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Attribute <string>]
[-Single]
[-Force]
[<CommonParameters>]
# ParameterSet LiteralPath
Get-NXTXmlNode
-LiteralPath <string[]>
-XPath <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Attribute <string>]
[-Single]
[-Force]
[<CommonParameters>]
# ParameterSet Xml
Get-NXTXmlNode
-XPath <string>
[-InputObject <XmlNode[]>]
[-Attribute <string>]
[-Single]
[-Force]
[<CommonParameters>]
Retrieves nodes from an existing XML document. The nodes are retrieved at the specified XPath location.
Get-NXTXmlNode -Path 'C:\Temp\test.xml' -XPath '/root/parent/child'
Retrieves the node 'child' from the XML document 'C:\Temp\test.xml' at the XPath location '/root/parent/child'.
Get-NXTXmlNode -Path 'C:\Temp\test.xml' -XPath '/root/parent/child' -Attribute 'InnerText' -Single
Retrieves the first child node's inner text from the 'C:\Temp\test.xml' document.
[xml]'<root><child id="1"/></root>' | Get-NXTXmlNode -XPath '/root/child' -Attribute 'id'
Retrieves the 'id' attribute from the child node of an existing xml object.
System.Xml.XmlDocument - The XML document(s) to add the new node to.
System.IO.FileInfo - The XML file(s) to add the new node to.
System.Xml.XmlDocument - The XML document(s) that were modified if the -PassThru parameter is specified.
System.String - The attribute value(s) of the node(s) that were retrieved.
The path to the XML file(s) to remove the node from.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the XML file(s) to remove the node from.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when the file is created. If the file exists, the encoding will not be updated.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The XML node(s) to remove the node from.
| Property | Value |
|---|---|
| Type: | XmlNode |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The XPath to the node to remove.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the attribute to retrieve from the node(s) at the specified XPath location. If not specified, the entire node(s) will be returned.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if only the first node found at the specified XPath location should be returned.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Imports an INI file.
# ParameterSet Path
Import-NXTIniFile
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-AsIniDocument]
[-Encoding <Encoding>]
[-UnboundArguments <List[Object]>]
[<CommonParameters>]
# ParameterSet LiteralPath
Import-NXTIniFile
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-AsIniDocument]
[-Encoding <Encoding>]
[-UnboundArguments <List[Object]>]
[<CommonParameters>]
Imports an INI file as a hashtable or as an IniDocument object with comments.
Import-NXTIniFile -Path 'C:\Temp\test.ini'
Imports the INI file 'C:\Temp\test.ini' as hashtable.
Import-NXTIniFile -Path 'C:\Temp\test' -AsIniDocument
Imports the INI file 'C:\Temp\test.ini' as an IniDocument object with comments.
System.String - The path to the INI file(s) to import.
System.IO.FileInfo - The INI file(s) to import.
System.Collections.Hashtable - The INI file as a hashtable if the -AsIniDocument parameter is specified.
PSADTNXT.Configuration.NxtIniDocument - The INI file as an IniDocument object with comments.
The path to the INI file(s) to import.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the INI file(s) to import.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
When specified, the function will return an IniDocument object with comments.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when reading the file. If not specified, the encoding will be detected from the file.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Unbound arguments that are passed to the function. These will be ignored but are useful for easier invocation of the function.
| Property | Value |
|---|---|
| Type: | ListObject |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | True (ByRemainingArguments) |
| Accept wildcard characters: | False |
Imports an XML file.
# ParameterSet Path
Import-NXTXmlFile
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Force]
[-UnboundArguments <List[Object]>]
[<CommonParameters>]
# ParameterSet LiteralPath
Import-NXTXmlFile
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Force]
[-UnboundArguments <List[Object]>]
[<CommonParameters>]
Imports an XML file.
Import-NXTXmlFile -Path 'C:\Temp\test.xml'
Imports the XML file 'C:\Temp\test.xml' as XmlDocument.
System.String - The path to the XML file(s) to import.
System.Xml.XmlDocument - The XML file as an XmlDocument object.
The path to the XML file(s) to import.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the XML file(s) to import.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The encoding to use when reading the file. If not specified, the encoding will be detected from the file.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Unbound arguments that are passed to the function. These will be ignored but are useful for easier invocation of the function.
| Property | Value |
|---|---|
| Type: | ListObject |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | True (ByRemainingArguments) |
| Accept wildcard characters: | False |
Installs an application based on the neo42 logic.
# ParameterSet ExitCodes
Install-NXTApplication
[-Target] <string>
[-ArgumentList <string[]>]
[-AdditionalArgumentList <string[]>]
[-Method <DeploymentMethod>]
[-Criteria <NxtApplicationCriteria>]
[-LogFileName <string>]
[-CacheDirectory <DirectoryInfo>]
[-Awaiter <INxtAwaiter[]>]
[-SuccessExitCodes <int[]>]
[-RebootExitCodes <int[]>]
[-ExitOnProcessFailure]
[-NoCache]
[<CommonParameters>]
# ParameterSet IgnoreExitCodes
Install-NXTApplication
[-Target] <string>
-IgnoreExitCodes
[-ArgumentList <string[]>]
[-AdditionalArgumentList <string[]>]
[-Method <DeploymentMethod>]
[-Criteria <NxtApplicationCriteria>]
[-LogFileName <string>]
[-CacheDirectory <DirectoryInfo>]
[-Awaiter <INxtAwaiter[]>]
[-NoCache]
[<CommonParameters>]
Contains all installer specific code to install and repair an application.
Install-NXTApplication -Target 'C:\Temp\test.msi' -ArgumentList '/quiet /norestart' -Method MSI
Installs the application using the MSI method with the specified arguments.
Install-NXTApplication -Target 'setup.exe' -Method Setup -AdditionalArgumentList '/silent' -LogFileName 'CustomInstall.log' -Criteria @{ Store = 'ARP'; Identifier = 'TestApp' }
Installs the application using the Setup method with the specified additional arguments and a custom log file name. The criteria is used to find the installed application for caching purposes.
System.IO.FileInfo - The path to the installer.
PSADT.ProcessManagement.ProcessResult - The result of the installation process.
The path or other identifier of the installer.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The arguments to pass to the installer.
This parameter will replace the default arguments of the defined Method.
Be aware that arguments are automatically escaped to ensure that they are properly formatted for the process start.
Manual escaping will be passed as a literal string to the process.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Additional arguments to pass to the installer. These are appended to ArgumentList.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The method to use for the installation.
| Property | Value |
|---|---|
| Type: | DeploymentMethod |
| Enum values: | Setup, Copy, MSI, InnoSetup, Nullsoft, BitRockInstaller, Burn, AppX |
| Position: | Named |
| Default value: | Setup |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The path to the log file ending with a .log extension.
This file will reside in the log directory of the ADT session.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The application lookup criteria used to find the application in a application store.
The resulting data is used for defaults, validation and backup mechanics.
If the application is already installed, its display name is used for the default LogFileName.
| Property | Value |
|---|---|
| Type: | NxtApplicationCriteria |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The directory where the package cache is located. This is used to store the uninstaller files if the NoCache parameter is not specified.
| Property | Value |
|---|---|
| Type: | DirectoryInfo |
| Position: | Named |
| Default value: | (& $script:CommandTable.'Get-ADTSession').NXT.Package.Directory |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Optional awaiter objects that should be evaluated post installation.
| Property | Value |
|---|---|
| Type: | INxtAwaiter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The exit codes that indicate a successful installation. If the exit code of the process is in this list, the installation is considered successful.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | - Defaults depend on the method and session configuration. |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The exit codes that indicate a reboot is required after the installation. If the exit code of the process is in this list, the installation is considered successful and a reboot is requested.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | - Defaults depend on the method and session configuration. |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that any exit code from the installation process should be ignored and treated as a success.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The session will be immediatly closed if the execution fails.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
For specific methods a copy of the uninstaller will be created in the cache directory. Specify this parameter to skip this step.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
This is the main function to deploy software packages.
Invoke-NXTDeployment
[[-ADTSession] <NxtDeploymentSession>]
[<CommonParameters>]
This function is the main function to deploy software packages.
It handles all the necessary steps to deploy a software package based on the configuration file.
Custom hook points are available to extend the deployment logic.
Invoke-NXTDeployment -ADTSession $adtSession
Invokes the deployment logic for the specified ADT session.
This function does not take any pipeline input.
This function does not return any output.
The ADT session for which the deployment is performed. This parameter is optional and will be set to the current ADT session if not specified.
| Property | Value |
|---|---|
| Type: | NxtDeploymentSession |
| Position: | 0 |
| Default value: | (& $script:CommandTable.'Get-ADTSession') |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Creates a new environment table.
New-NXTEnvironmentTable
[<CommonParameters>]
Creates a new environment table. Used to substitute the environment table in the ADT session.
This function is supposed to be used in conjunction with Initialize-ADTSession's -AdditionalEnvironmentVariables parameter.
This function does not take any pipeline input.
[System.Collections.ObjectModel.ReadOnlyDictionary2System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089,System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]`
This function does not have any documented parameters.
Creates a new folder with predefined permissions.
# ParameterSet Path
New-NXTFolderWithPermission
[-Path] <string[]>
[-FullControl <IdentityReference[]>]
[-Write <IdentityReference[]>]
[-Modify <IdentityReference[]>]
[-ReadAndExecute <IdentityReference[]>]
[-Owner <IdentityReference>]
[-CustomDirectorySecurity <DirectorySecurity>]
[-Hide]
[-Force]
[-Inherit]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Creates a new folder with predefined permissions.
New-NXTFolderWithPermission -Path 'C:\Temp\MyFolder' -FullControl 'DOMAIN\User1', 'BuiltinAdministratorsSid' -Write 'S-1-1-0' -Owner 'DOMAIN\User1'
Creates a new folder at 'C:\Temp\MyFolder' with full control permissions for 'DOMAIN\User1' and 'Administrators', write permissions for 'Everyone', and sets 'DOMAIN\User1' as the owner.
System.String - The path to the folder(s) to create.
System.IO.DirectoryInfo - The created folder(s).
The path to the folder to create.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The user(s) or group(s) to grant full control permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant write permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant modify permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant read and execute permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user or group to set as the owner of the folder.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A custom DirectorySecurity object to use as base for the folder permissions. Default is a new DirectorySecurity object.
| Property | Value |
|---|---|
| Type: | DirectorySecurity |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that the folder should be hidden.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that if the folder already exists, it should be deleted and recreated.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that the folder should inherit permissions from the parent folder. Otherwise, the permissions are protected.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Returns the created folder if specified.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Retrieves the parameters for the the Open-ADTSession function.
New-NXTSessionParameter
[-Invocation] <InvocationInfo>
[[-ScriptDirectory] <DirectoryInfo>]
[[-SetupCfg] <FileInfo[]>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Collects all required parameters for the Open-ADTSession function and returns them as a dictionary for use with Open-ADTSession.
Get-NXTSessionParameter -Invocation $MyInvocation
Retrieves the parameters for the Open-ADTSession function from the current invocation.
This function does not take any pipeline input.
System.Collections.Generic.DictionarySystem.String, System.Object - The parameters for the Open-ADTSession function.
The invocation of the deploy script to retrieve the parameters from.
| Property | Value |
|---|---|
| Type: | InvocationInfo |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The directory from which all source files are read. Defaults to the invocation script location.
| Property | Value |
|---|---|
| Type: | DirectoryInfo |
| Position: | 1 |
| Default value: | System.IO.Path::GetDirectoryName($Invocation.MyCommand.Definition) |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A list of paths to Setup.cfg files to load and merge for the session.
| Property | Value |
|---|---|
| Type: | FileInfo |
| Position: | 2 |
| Default value: | Setup.cfg, CustomSetup.cfg |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Creates and configures a new temporary folder.
New-NXTTemporaryFolder
[-WhatIf]
[-Confirm]
[<CommonParameters>]
This function generates a new temporary folder in a specified or default root path, ensuring the folder has specific security permissions set.
If the provided root path doesn't exist or has incorrect permissions, it will be recreated accordingly.
The function ensures unique naming for the temporary folder and outputs its path upon successful creation.
New-NxtTemporaryFolder
Will create a new folder.
This function does not take any pipeline input.
System.IO.DirectoryInfo - The created temporary folder.
This function does not have any documented parameters.
Creates a new sub node in an existing XML document.
# ParameterSet Path
New-NXTXmlNode
[-Path] <string[]>
-XPath <string>
-Name <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Attributes <hashtable>]
[-Prefix <string>]
[-InnerText <string>]
[-Force]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
New-NXTXmlNode
-LiteralPath <string[]>
-XPath <string>
-Name <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Attributes <hashtable>]
[-Prefix <string>]
[-InnerText <string>]
[-Force]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet Xml
New-NXTXmlNode
-XPath <string>
-Name <string>
[-InputObject <XmlNode[]>]
[-Attributes <hashtable>]
[-Prefix <string>]
[-InnerText <string>]
[-Force]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Creates a new sub node in an existing XML document. The node is created at the specified XPath location.
The XPath must point to a single node. If the node already has child nodes, the -Force switch must be used to overwrite them.
New-NXTXmlNode -Path 'C:\Temp\test.xml' -XPath '/root/parent' -Name 'child' -Attributes @{ attr1 = 'value1'; attr2 = 'value2' } -InnerText 'Hello World'
Creates a new node 'child' in the XML document 'C:\Temp\test.xml' at the XPath location '/root/parent'.
The new node will have the attributes 'attr1' and 'attr2' set to 'value1' and 'value2', respectively. The inner text of the new node will be set to 'Hello World'.
System.Xml.XmlDocument - The XML document(s) to create the new node in.
System.IO.FileInfo - The XML file(s) to create the new node in.
[System.Xml.XmlDocument[]]
The path to the XML file(s) to create the node in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the XML file(s) to create the node in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when writing and reading the file. If not specified, the encoding will be detected from the file.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | $OutputEncoding |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The XML node(s) to create the new node in.
| Property | Value |
|---|---|
| Type: | XmlNode |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The XPath to the node to create the new node in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the new node to create.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A hashtable of attributes to set on the new node.
| Property | Value |
|---|---|
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The prefix to set on the new node.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The inner text to set on the new node.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if the existing child nodes should be removed before creating the new node.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Returns the XML document if specified.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Removes a specific hook.
Remove-NXTDeploymentCallback
[-Callback] <CommandInfo[]>
[-HookPoint] <DeploymentHookPoint[]>
[<CommonParameters>]
The Remove-NXTDeploymentCallback function removes a custom hook from the deployment session that was previously added with Add-NXTDeploymentCallback.
Remove-NXTDeploymentCallback -HookPoint 'CustomInstallEnd' -Callback (Get-Command -Name 'My-CustomFunction')
This example removes a custom callback function named 'My-CustomFunction' from the 'CustomInstallEnd' hook point in the deployment session.
This function does not take any pipeline input.
This function does not return any output.
The callback function to remove from the deployment session.
| Property | Value |
|---|---|
| Type: | CommandInfo |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the deployment hook point after which the custom hook should be executed.
| Property | Value |
|---|---|
| Type: | DeploymentHookPoint |
| Enum values: | CustomBegin, CustomInstallAndReinstallAndSoftMigrationBegin, CustomSoftMigrationBegin, CustomSoftMigrationEnd, CustomInstallAndReinstallAndSoftMigrationEnd, CustomInstallAndReinstallPreInstallAndReinstall, CustomReinstallPreUninstall, CustomReinstallPostUninstallOnError, CustomReinstallPostUninstall, CustomReinstallPreInstall, CustomReinstallPostInstallOnError, CustomReinstallPostInstall, CustomInstallBegin, CustomInstallEndOnError, CustomInstallEnd, CustomInstallAndReinstallEnd, CustomUninstallBegin, CustomUninstallEndOnError, CustomUninstallEnd, CustomInstallUserPartBegin, CustomInstallUserPartEnd, CustomUninstallUserPartBegin, CustomUninstallUserPartEnd, CustomEnd, CustomEndOnError |
| Position: | 1 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Removes only empty folders.
# ParameterSet Path
Remove-NXTEmptyFolder
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Force]
[-RootPath <string>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Remove-NXTEmptyFolder
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Force]
[-RootPath <string>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
This function is designed to remove folders if and only if they are empty.
If the specified folder contains any files or other items, the function continues without taking any action.
Remove-NxtEmptyFolder -Path "C:\Temp\MyFolder"
Removes the folder "C:\Temp\MyFolder" if it is empty.
System.IO.DirectoryInfo - The folder(s) to remove.
This function does not return any output.
The path to the folder(s) to remove.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the folder(s) to remove.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
Determines if hidden folders should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The path to the root folder to stop the recursion at.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Removes only empty INI files.
# ParameterSet Path
Remove-NXTEmptyIniFile
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Remove-NXTEmptyIniFile
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
This function is designed to remove INI files if and only if they are empty.
If the specified INI file contains any key-value pairs, the function continues without taking any action.
Remove-NxtEmptyIniFile -Path "SomeEmptyIniFile.ini"
Removes the INI file "SomeEmptyIniFile.ini" if it is empty.
System.IO.FileInfo - The INI file(s) to remove.
This function does not return any output.
The path to the INI file(s) to remove.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the INI file(s) to remove.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
Removes only empty registry keys
Remove-NXTEmptyRegistryKey
[-Key] <string>
[-Wow6432Node]
[-Sid <string>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
This function is designed to remove registry keys if and only if they are empty. If the specified registry contains any values or sub keys,
the function continues without taking any action.
Remove-NxtEmptyRegistryKey -Key "HKLM:\Software\EmptyKey"
This example removes the specified empty key located at "HKLM:\Software\EmptyKey".
Microsoft.Win32.RegistryKey - The registry key(s) to remove.
This function does not return any output.
The registry key(s) to remove.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | True |
Specifies whether to include the Wow6432Node on 64-bit systems.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The SID of the user to use for the registry key in case of a user registry key.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Removes a path from the PATH environment variable.
Remove-NXTPathVariable
[-Path] <string[]>
[-Target <EnvironmentVariableTarget>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The Remove-NXTPathVariable cmdlet removes a path from the PATH environment variable of a specified target.
Remove-NXTPathVariable -Path 'C:\Program Files\Example\bin'
Removes the path 'C:\Program Files\Example\bin' from the PATH variable of the current process.
Remove-NXTPathVariable -Path 'C:\Program Files\Example\bin' -Target Machine
Removes the path 'C:\Program Files\Example\bin' from the PATH variable of the machine.
System.String - The path(s) to remove from the PATH variable.
System.IO.FileInfo - The path(s) to remove from the PATH variable.
This function does not return any output.
The path(s) to remove from the PATH variable.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Determines the scope of the PATH variable to be modified.
| Property | Value |
|---|---|
| Type: | EnvironmentVariableTarget |
| Enum values: | Process, User, Machine |
| Position: | Named |
| Default value: | Machine |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Removes a service from the system.
Remove-NXTService
[-Name] <string[]>
[[-Timeout] <timespan>]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The Remove-NXTService cmdlet removes a service from the system by stopping it and deleting it.
Remove-NXTService -Name 'MyService'
Removes the service named 'MyService' from the system, stopping it first if it is running.
Remove-NXTService -Name 'MyService' -Force
Removes the service named 'MyService' from the system without stopping it first and without validating dependencies.
System.String - The name(s) of the service(s) to remove.
System.ServiceProcess.ServiceController - The service object(s) to remove.
This function does not return any output.
The name(s) of the service(s) to remove.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Will delete the service even if it did not stop in time, has dependencies or is already marked for deletion.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The time to wait for the service to stop before removing it.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | 1 |
| Default value: | 00:01:00 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Removes a node from an existing XML document.
# ParameterSet Path
Remove-NXTXmlNode
[-Path] <string[]>
-XPath <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Force]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Remove-NXTXmlNode
-LiteralPath <string[]>
-XPath <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Force]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet Xml
Remove-NXTXmlNode
-XPath <string>
[-InputObject <XmlNode[]>]
[-Force]
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Removes a node from an existing XML document. The node is removed at the specified XPath location.
The XPath must point to a single node. If the node has child nodes, the -Force switch must be used to remove them.
Remove-NXTXmlNode -Path 'C:\Temp\test.xml' -XPath '/root/parent/child'
Removes the node 'child' from the XML document 'C:\Temp\test.xml' at the XPath location '/root/parent/child'.
System.Xml.XmlNode - The XML node(s) or document(s) to remove the node from.
System.IO.FileInfo - The XML file(s) to remove the node from.
System.Xml.XmlNode - The XML node(s) or document(s) that were modified if the -PassThru parameter is specified.
The path to the XML file(s) to remove the node from.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the XML file(s) to remove the node from.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when the file is created. If the file exists, the encoding will not be updated.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | $OutputEncoding |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The XML node(s) to remove the node from.
| Property | Value |
|---|---|
| Type: | XmlNode |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The XPath to the node to remove.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if all matching nodes should be removed if more than one node is found.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Returns the XML document if specified.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Resolves common PowerShell path parameters to their qualified full paths.
# ParameterSet Path
Resolve-NXTPath
[-Path] <string[]>
[-IncludeNonExistent]
[-AsProviderPath]
[-ProviderName <string>]
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Force]
[-PathType <TestPathType>]
[-UnboundArguments <List[Object]>]
[<CommonParameters>]
# ParameterSet LiteralPath
Resolve-NXTPath
-LiteralPath <string[]>
[-IncludeNonExistent]
[-AsProviderPath]
[-ProviderName <string>]
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Force]
[-PathType <TestPathType>]
[-UnboundArguments <List[Object]>]
[<CommonParameters>]
Resolves common PowerShell path parameters to their qualified full paths.
It can take any object containing a PSPath that was retrieved via a PowerShell provider.
This function imitates the behavior of the PowerShell internal LocationGlobber.
Resolve-NXTPath -Path "C:\Windows\System32\*" -Filter '*.exe' -Include 'cmd*'
Returns all executable files in the System32 directory that start with 'cmd'.
Resolve-NXTPath @PSBoundParameters -AsProviderPath
Returns the provider paths of all bound parameters that match a PowerShell path parameter.
Get-Item -Path "HKLM:\Software" | Resolve-NXTPath -AsProviderPath
Returns the HKEY_LOCAL_MACHINE\Software provider path for the given item.
This function does not take any pipeline input.
[System.String[]]
Includes non-existent paths in the output.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Returns the provider path instead of the fully qualified PSPath.
This is useful when when you work with .NET objects that do not support provider paths.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Will use the given provider to resolve the path. If not specified, the provider is determined from the path itself.
It is recommended to specify the provider in order to limit the output to a specific provider.
Specifying the provider will also enable to resolve provider paths. A useful example is the Registry provider
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The path to resolve.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | True |
The literal path to resolve.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to apply to the resolved paths.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
An array of patterns to exclude from the resolved paths.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
An array of patterns to include in the resolved paths.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
Forces the resolution of hidden or system items.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Limits the output to the given path type.
Useful for example to filter for files or directories.
| Property | Value |
|---|---|
| Type: | TestPathType |
| Enum values: | Any, Container, Leaf |
| Position: | Named |
| Default value: | Any |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Restart the script if one of the conditions is met.
Restart-NXTDeployScript
[-Invocation] <InvocationInfo>
[-When32on64Bit]
[-WhenTriggerDeployment]
[<CommonParameters>]
Designed as a helper script to remove as much logic as possible from the main script.
Restart conditions can be specified with the defined switch parameters.
NOTE
Be the script will run in a new process and the DeploymentType parameter will be cleared to avoid a trigger loop.
The calling script will wait for the new process to finish and stop the execution with the exit code of the new process.
Any logging to the console will be lost.
Restart-NXTDeployScript -When32on64Bit -WhenTriggerDeployment
Restart the script when the current process is 32-bit on a 64-bit OS or when the DeploymentType parameter is a trigger.
This function does not take any pipeline input.
This function does not return any output.
The invocation information of the current script.
| Property | Value |
|---|---|
| Type: | InvocationInfo |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Restart the script if the current process is 32-bit on a 64-bit OS.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Restart the script if the DeploymentType parameter is a trigger.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Replaces Set-Content with neo42 encoding handling for files.
# ParameterSet Path
Set-NXTContent
[-Path] <string[]>
[-Value] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-PassThru]
[-NoNewLine]
[-Force]
[-Encoding <Encoding>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Set-NXTContent
[-Value] <string[]>
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-PassThru]
[-NoNewLine]
[-Force]
[-Encoding <Encoding>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
It's use is limited to only files and it will determine the encoding of the file and use that if no encoding is specified.
Should the detection fail, or if the file doesn't exist, it will use the encoding defined in the DefaultEncoding parameter.
Important note: If the file exists and the encoding is specified, the encoding will not be updated. Only the new content will be written with the specified encoding.
Set-NXTContent -Path 'C:\Temp\test.txt' -Value 'Hello World'
Sets the content 'Hello World' to the file 'C:\Temp\test.txt'.
Set-NXTContent -Path 'C:\Temp\test.txt' -Value 'Hello World' -Encoding UTF8
Sets the content 'Hello World' to the file 'C:\Temp\test.txt' using the UTF8 encoding.
System.String - The content to set to the file(s).
System.IO.FileInfo - The file(s) to set content to.
System.String[] - The content that was set to the file(s) if the -PassThru parameter is specified.
The path to the file(s) to set content to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the file(s) to set content to.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The content to set to the file(s).
| Property | Value |
|---|---|
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
Returns the content set to the file(s) if specified.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Do not append a newline character to the content.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if the Read-Only attribute should be ignored when setting the content of the file or hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when the file is created. If the file exists, the encoding will not be updated.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Replaces existing access control permissions on a specified, existing folder with the provided permissions.
# ParameterSet Path
Set-NXTFolderPermission
[-Path] <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-FullControl <IdentityReference[]>]
[-Write <IdentityReference[]>]
[-Modify <IdentityReference[]>]
[-ReadAndExecute <IdentityReference[]>]
[-Owner <IdentityReference>]
[-CustomDirectorySecurity <DirectorySecurity>]
[-Inherit]
[-Recurse]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Set-NXTFolderPermission
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-FullControl <IdentityReference[]>]
[-Write <IdentityReference[]>]
[-Modify <IdentityReference[]>]
[-ReadAndExecute <IdentityReference[]>]
[-Owner <IdentityReference>]
[-CustomDirectorySecurity <DirectorySecurity>]
[-Inherit]
[-Recurse]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
The function allows granular control over the access permissions of a specified folder.
It can assign specific permission levels (e.g., Full Control, Modify, Write, Read & Execute) to identity references (SID, user name or group name).
The function also provides options to set the owner, manage custom directory security settings, and control the inheritance of permissions.
It is capable of applying these settings to both the target folder and its sub-folders.
Set-NXTFolderWithPermission -Path 'C:\Temp\MyFolder' -FullControl 'DOMAIN\User1', 'BuiltinAdministratorsSid' -Write 'S-1-1-0' -Owner 'DOMAIN\User1'
Sets permissions for folder 'C:\Temp\MyFolder' to full control permissions for 'DOMAIN\User1' and 'Administrators', write permissions for 'Everyone' and sets 'DOMAIN\User1' as the owner.
System.String - The path to the folder(s) to set permissions on.
System.IO.DirectoryInfo - The folder(s) to set permissions on.
This function does not return any output.
The path to the folder(s) to set permissions on.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the folder(s) to set permissions on.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The user(s) or group(s) to grant full control permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant write permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant modify permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) to grant read and execute permissions to.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user or group to set as the owner of the folder.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A custom DirectorySecurity object to use as base for the folder permissions. Default is a new DirectorySecurity object.
| Property | Value |
|---|---|
| Type: | DirectorySecurity |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that the folder should inherit permissions from the parent folder. Otherwise, the permissions are protected.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that the permissions should be applied to all sub-folders of the specified folder.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Updates an existing XML node in an XML document.
# ParameterSet Path
Set-NXTXmlNode
[-Path] <string[]>
-XPath <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Name <string>]
[-Attributes <hashtable>]
[-InnerText <string>]
[-PassThru]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Set-NXTXmlNode
-LiteralPath <string[]>
-XPath <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Encoding <Encoding>]
[-Name <string>]
[-Attributes <hashtable>]
[-InnerText <string>]
[-PassThru]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet Xml
Set-NXTXmlNode
-XPath <string>
[-InputObject <XmlNode[]>]
[-Name <string>]
[-Attributes <hashtable>]
[-InnerText <string>]
[-PassThru]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Updates an existing XML node in an XML document. The node is updated at the specified XPath location.
The XPath must point to a single node. Values of the specified node will be updated.
Set-NXTXmlNode -Path 'C:\Temp\test.xml' -XPath '/root/parent/child' -Attributes @{ attr1 = 'newValue1'; attr2 = 'newValue2' } -InnerText 'New Inner Text'
Updates the existing node 'child' in the XML document 'C:\Temp\test.xml' at the XPath location '/root/parent/child'.
System.Xml.XmlNode - A node of an XML document(s) or the document(s) to update the node in.
System.IO.FileInfo - The XML file(s) to update the node in.
System.Xml.XmlNode - The XML nodes or document(s) that were modified if the -PassThru parameter is specified.
The path to the XML file(s) to update the node in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the XML file(s) to update the node in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when reading the file. If not specified, the encoding will be detected from the file.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The XML node(s) to update.
| Property | Value |
|---|---|
| Type: | XmlNode |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The XPath to the node to update.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The name of the node to update.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A hashtable of attributes to set on the node.
| Property | Value |
|---|---|
| Type: | Hashtable |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The inner text to set on the node.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Returns the XML document if specified.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if the Read-Only attribute should be ignored when setting the content of the file or hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows an installation welcome dialog to the user, optionally allowing them to defer the installation if blocking processes are detected.
Show-NXTInstallationWelcome
[[-ADTSession] <NxtDeploymentSession>]
[[-Title] <string>]
[[-CloseProcesses] <NxtCloseProcess[]>]
[[-DeferTimes] <uint32>]
[[-DeferDays] <uint32>]
[[-DeferDeadline] <datetime>]
[[-DeferRunInterval] <timespan>]
[[-Timeout] <timespan>]
[[-ContinueType] <ContinueType>]
[-MinimizeWindows]
[-CustomText]
[-AllowDeferCloseProcesses]
[-NotTopMost]
[-PersistPrompt]
[-HideCloseButton]
[-AllowMove]
[-NoBalloonTip]
[-AllowDoNotDisturb]
[-BlockExecution]
[-DeploymentDefaults]
[<CommonParameters>]
Shows an installation welcome dialog to the user, optionally allowing them to defer the installation if blocking processes are detected.
Wraps the Show-ADTInstallationWelcome function to provide NXT-specific functionality.
Enables support for reading values from the SetupCfg file and passing them to the Show-ADTInstallationWelcome function.
NOTE
This function is already built into the Invoke-NXTDeployment function.
Only use this function if you want to show the installation welcome for custom cases.
This function does not take any pipeline input.
This function does not return any output.
The title of the installation welcome dialog.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 1 |
| Default value: | $ADTSession.InstallTitle |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A list of processes that may block the installation.
| Property | Value |
|---|---|
| Type: | NxtCloseProcess |
| Position: | 2 |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The type of action to take if the the dialog times out.
| Property | Value |
|---|---|
| Type: | ContinueType |
| Enum values: | Abort, Continue |
| Position: | 8 |
| Default value: | Abort |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to minimize all windows when the dialog is shown.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to show custom text in the dialog. The text is defined in the toolkit configuration.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Will allow the user to defer the installation.
Granular control is available via the DeferTimes, DeferDays, and DeferDeadline parameters.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The number of times the user can defer the installation.
| Property | Value |
|---|---|
| Type: | UInt32 |
| Position: | 3 |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The number of days the user can defer the installation.
This option qualifies the DeferTimes option and is only used if DeferTimes is set.
| Property | Value |
|---|---|
| Type: | UInt32 |
| Position: | 4 |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The date and time when the installation can no longer be deferred. If DeferDays is set, the earliest date will be used.
| Property | Value |
|---|---|
| Type: | NullableDateTime |
| Position: | 5 |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A time span before the next interactive deployment is attempted.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | 6 |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to not show the dialog as a top-most window.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to persist the prompt for the user to close blocking processes.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to hide the close button on the dialog.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to allow the user to move the dialog.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to suppress the balloon tip after the installation welcome dialog is closed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to suppress the installation welcome dialog if the user has Do Not Disturb enabled on their session.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to block the execution of the deployment until the deployment is closed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The time to wait before the dialog times out.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | 7 |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Whether to use the deployment defaults for the installation welcome dialog.
Any parameter specified will override the deployment defaults.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The current ADT session. Requires the extension session to be initialized.
| Property | Value |
|---|---|
| Type: | NxtDeploymentSession |
| Position: | 0 |
| Default value: | (& $script:CommandTable.'Get-ADTSession') |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Stops a specified process using the given criteria.
# ParameterSet Name
Stop-NXTProcess
[-Name] <string[]>
[-KillProcessTree]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet Id
Stop-NXTProcess
-Id <int[]>
[-KillProcessTree]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet Process
Stop-NXTProcess
-Process <Process[]>
[-KillProcessTree]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet ProcessDefinition
Stop-NXTProcess
-ProcessDefinition <ProcessDefinition[]>
[-KillProcessTree]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
This function stops a process based on its name, ID, or a filter applied to running processes.
Stop-NXTProcess -Name "notepad.exe"
This example stops all instances of Notepad running on the system.
System.String - The name of the process to stop.
System.Int32 - The process ID to check.
System.Diagnostics.Process - The process to check.
Microsoft.Management.Infrastructure.CimInstance - The Win32_Process cim instance to stop.
PSADT.ProcessManagement.ProcessDefinition - The process definition to stop.
PSADT.ProcessManagement.RunningProcess - The running process to stop.
PSADTNXT.ProcessManagement.NxtCloseProcess - The process definition to stop.
This function does not return any output.
The name of the process to stop.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The ID of the process to stop. Id 0 is not allowed.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
The process object to stop.
| Property | Value |
|---|---|
| Type: | Process |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
The process definition to stop.
| Property | Value |
|---|---|
| Type: | ProcessDefinition |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
Include all child processes when stopping the specified process.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Test if a file is in locked by another process.
Test-NXTFileInUse
[-Path] <string[]>
[<CommonParameters>]
Test if a file is locked by another process.
It can only successfully test if the process has read/write access to the file.
Test-NXTFileInUse -Path 'C:\Temp\file.txt'
Check if the file 'C:\Temp\file.txt' is locked another process.
System.IO.FileInfo - The file to test.
System.Boolean - Returns true if the file is locked, otherwise false.
The path to the file to test.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
Checks and compares the actual permissions of a specified folder against expected permissions.
Test-NXTFolderPermission
[-Path] <string>
[-FullControl <IdentityReference[]>]
[-Write <IdentityReference[]>]
[-Modify <IdentityReference[]>]
[-ReadAndExecute <IdentityReference[]>]
[-Owner <IdentityReference>]
[-CustomDirectorySecurity <DirectorySecurity>]
[-IsInherited <bool>]
[<CommonParameters>]
Test-NxtFolderPermissions evaluates a folder's security settings by comparing its actual permissions, owner, and other security attributes against predefined expectations.
It's useful for ensuring folder permissions align with security policies or compliance standards.
Test-NXTFolderWithPermission -Path 'C:\Temp\MyFolder' -FullControl 'DOMAIN\User1', 'BuiltinAdministratorsSid' -Write 'S-1-1-0' -Owner 'DOMAIN\User1'
Tests if a folder 'C:\Temp\MyFolder' has these permissions: full control permissions for 'DOMAIN\User1' and 'Administrators', write permissions for 'Everyone', and 'DOMAIN\User1' as owner.
System.IO.FileInfo - The folder to check.
[System.Boolean]
The path to the folder whose permissions are to be checked.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The user(s) or group(s) that should have full control permissions.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) that should have write permissions.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) that should have modify permissions.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user(s) or group(s) that should have read and execute permissions.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The user or group that should be set as the owner of the folder.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
A custom DirectorySecurity object to use as a base for the folder permissions. If not specified, a new DirectorySecurity object is created.
| Property | Value |
|---|---|
| Type: | DirectorySecurity |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Test if permissions are inherited from the parent folder. Only access rules with a matching inheritance state are taken into account when the requested permissions are verified.
| Property | Value |
|---|---|
| Type: | Boolean |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Checks if a process is running as the system account.
Test-NXTIsSystemProcess
[[-Id] <int>]
[<CommonParameters>]
Checks if a process is running as the system account.
Test-NxtIsSystemProcess -Id 1234
Checks if the process with ID 1234 is running as the system account.
System.Int32 - The process ID to check.
System.Diagnostics.Process - The process to check.
Microsoft.Management.Infrastructure.CimInstance - The Win32_Process cim instance to check.
System.Boolean - Returns true if the process is running as the system account, otherwise false.
The process ID to check.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | 0 |
| Default value: | $PID |
| Required: | False |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
Tests for the existence of a process.
# ParameterSet Name
Test-NXTProcess
[-Name] <string>
[<CommonParameters>]
# ParameterSet Id
Test-NXTProcess
-Id <int>
[<CommonParameters>]
# ParameterSet ProcessDefinition
Test-NXTProcess
-ProcessDefinition <ProcessDefinition>
[<CommonParameters>]
The Test-NxtProcessExists function checks if a specified process is currently running on the system.
Test-NXTProcess -Name "notepad.exe"
Tests if any instance of Notepad is running on the system.
System.String - The name of the process to monitor.
System.Int32 - The process ID to monitor.
System.Diagnostics.Process - The process to monitor.
Microsoft.Management.Infrastructure.CimInstance - The Win32_Process cim instance to monitor.
PSADT.ProcessManagement.ProcessDefinition - The process definition to monitor.
PSADTNXT.ProcessManagement.NxtCloseProcess - The process definition to stop.
System.Boolean - Returns true if the process starts within the timeout period, otherwise false.
The name(s) of the process to check for. This parameter is mandatory.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The ID(s) of the process to check for.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
The process definition to check for.
| Property | Value |
|---|---|
| Type: | ProcessDefinition |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
Searches for a specified string or regex pattern within a file.
Test-NXTStringInFile
[-Path] <string[]>
[-Query] <string>
[-PatternType <StringCompareOperator>]
[-CaseSensitive]
[-Encoding <Encoding>]
[-Force]
[<CommonParameters>]
The Test-NxtStringInFile function searches for a specified string or regex pattern within a file and returns a Boolean result.
It supports regular expression searches, case-insensitive searches, and can handle different file encodings.
Test-NXTStringInFile -Path 'C:\Temp\test.txt' -Query 'Hello World' -PatternType 'Equals'
Searches for the exact string 'Hello World' in the file 'C:\Temp\test.txt'.
System.IO.FileInfo - The file to search in.
System.Boolean - Returns true if the string or pattern is found in the file, otherwise false.
The path to the file to search in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The query string to search for in the file.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The type of pattern to use for the search.
| Property | Value |
|---|---|
| Type: | StringCompareOperator |
| Enum values: | Equals, Contains, StartsWith, EndsWith, Wildcard, Regex |
| Position: | Named |
| Default value: | Contains |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies whether the search should be case-sensitive.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when reading the file. If not specified, the encoding will be detected from the file.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if hidden files should be processed.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Checks if the current UI theme is light.
Test-NXTUiLightTheme
[[-Identity] <IdentityReference>]
[<CommonParameters>]
Checks if the current UI theme is light by checking the registry keys for the light theme settings.
Will try to read the 'AppsUseLightTheme' and 'SystemUsesLightTheme' registry values.
Test-NXTUiLightTheme
Checks if the current UI theme is light and returns a boolean value.
This function does not take any pipeline input.
[System.Boolean]
The Identifier (e.g. Sid) of the user to check the theme for. If not specified, the current user will be used.
| Property | Value |
|---|---|
| Type: | IdentityReference |
| Position: | 0 |
| Default value: | System.Security.Principal.WindowsIdentity::GetCurrent().User.Value |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Tests for the existence of a node in an XML document.
# ParameterSet Path
Test-NXTXmlNode
[-Path] <string[]>
-XPath <string>
[-Encoding <Encoding>]
[-Force]
[<CommonParameters>]
# ParameterSet Xml
Test-NXTXmlNode
-XPath <string>
[-InputObject <XmlNode>]
[-Force]
[<CommonParameters>]
Tests for the existence of a node in an XML document. The node is located at the specified XPath location.
Test-NXTXmlNode -Path 'C:\Temp\test.xml' -XPath '/root/parent[@attribute="value"]/child'
Tests if the specified node exists in the XML file at the specified path.
System.Xml.XmlDocument - The XML document(s) to test the node in.
System.IO.FileInfo - The XML file(s) to test the node in.
[System.Boolean]
The path to the XML file(s) to test the node in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The encoding to use when writing and reading the file. If not specified, the encoding will be detected from the file.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | $OutputEncoding |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The XML node(s) to test the node in.
| Property | Value |
|---|---|
| Type: | XmlNode |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The XPath to the node to test the node in.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if hidden files should be included when resolving the Path parameter.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Uninstalls an application based on the neo42 logic.
# ParameterSet ManualExitCodes
Uninstall-NXTApplication
[[-Target] <string>]
[-Criteria <NxtApplicationCriteria>]
[-Method <DeploymentMethod>]
[-ArgumentList <string[]>]
[-AdditionalArgumentList <string[]>]
[-CacheDirectory <DirectoryInfo>]
[-Awaiter <INxtAwaiter[]>]
[-LogFileName <string>]
[-SuccessExitCodes <int[]>]
[-RebootExitCodes <int[]>]
[-ExitOnProcessFailure]
[-NoCache]
[<CommonParameters>]
# ParameterSet PackageIgnoreExitCodes
Uninstall-NXTApplication
[-Package] <NxtRegisteredPackage>
-IgnoreExitCodes
[-Awaiter <INxtAwaiter[]>]
[-LogFileName <string>]
[-NoCache]
[<CommonParameters>]
# ParameterSet PackageExitCodes
Uninstall-NXTApplication
[-Package] <NxtRegisteredPackage>
[-Awaiter <INxtAwaiter[]>]
[-LogFileName <string>]
[-SuccessExitCodes <int[]>]
[-RebootExitCodes <int[]>]
[-ExitOnProcessFailure]
[-NoCache]
[<CommonParameters>]
# ParameterSet ApplicationIgnoreExitCodes
Uninstall-NXTApplication
[-Application] <InstalledApplication>
-IgnoreExitCodes
[-Method <DeploymentMethod>]
[-ArgumentList <string[]>]
[-AdditionalArgumentList <string[]>]
[-CacheDirectory <DirectoryInfo>]
[-Awaiter <INxtAwaiter[]>]
[-LogFileName <string>]
[-NoCache]
[<CommonParameters>]
# ParameterSet ApplicationExitCodes
Uninstall-NXTApplication
[-Application] <InstalledApplication>
[-Method <DeploymentMethod>]
[-ArgumentList <string[]>]
[-AdditionalArgumentList <string[]>]
[-CacheDirectory <DirectoryInfo>]
[-Awaiter <INxtAwaiter[]>]
[-LogFileName <string>]
[-SuccessExitCodes <int[]>]
[-RebootExitCodes <int[]>]
[-ExitOnProcessFailure]
[-NoCache]
[<CommonParameters>]
# ParameterSet ManualIgnoreExitCodes
Uninstall-NXTApplication
[[-Target] <string>]
-IgnoreExitCodes
[-Criteria <NxtApplicationCriteria>]
[-Method <DeploymentMethod>]
[-ArgumentList <string[]>]
[-AdditionalArgumentList <string[]>]
[-CacheDirectory <DirectoryInfo>]
[-Awaiter <INxtAwaiter[]>]
[-LogFileName <string>]
[-NoCache]
[<CommonParameters>]
Contains all installer specific code to uninstall an application.
Supports multiple parameter sets to allow for different types of application definitions.
Uninstall-NXTApplication -Target '$envProgramFiles\myprogram\uninstall.exe' -ArgumentList '\q'
Starts the uninstall.exe with the '\q' parameter but without any further logic attached to it (Method: Setup)
Uninstall-NXTApplication -Target '{5DE0DE9D-5ABE-453E-8A84-A4BF443FC24B}' -Method MSI
Uninstalls the MSI application that is registered with above product code.
Uninstall-NXTApplication -Criteria @{ Store = 'ARP'; Identifier = 'TestApp' }
Uninstalls the application found by the criteria using its registered uninstall information and validates its removal afterwards.
Get-NXTApplication -Identifier '{0420EDC6-CF5E-4C88-8D5E-B81A5E7F3D6A}' | Uninstall-NXTApplication
Uninstalls the application using a application object obtained from the NXT function.
Get-ADTApplication -Name 'Test' -NameMatch 'Exact' | Uninstall-NXTApplication
Uninstalls the application using a application object obtained from the ADT function.
Get-NXTRegisteredPackage -PackageId '{0420EDC6-CF5E-4C88-8D5E-B81A5E7F3D6A}' | Uninstall-NXTApplication
Uninstalls the application referenced by a registered package object.
Uninstall-NXTApplication -Target 'Microsoft.WindowsScan_8wekyb3d8bbwe' -Method Appx
Deprovisions the Windows Scanner Appx app for all users.
PSADTNXT.Package.NxtRegisteredPackage - The registered package to use for the uninstallation.
PSADT.Types.InstalledApplication - The installed application to use for the uninstallation.
System.IO.FileInfo - The file to use for the uninstallation.
PSADT.ProcessManagement.ProcessResult - The result of the uninstallation process.
The path to the uninstaller file.
If not specified, the target is resolved from the application found by the Criteria.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The installed application object to use for the uninstallation.
| Property | Value |
|---|---|
| Type: | InstalledApplication |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The registered package object to use for the uninstallation.
| Property | Value |
|---|---|
| Type: | NxtRegisteredPackage |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
The application lookup criteria used to find the application in a application store.
The resulting data is used for defaults, validation and backup mechanics.
Values that are not specified (Target, Method, ArgumentList, LogFileName) default to the data of the found application.
After the uninstallation, the criteria must no longer match any application.
| Property | Value |
|---|---|
| Type: | NxtApplicationCriteria |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The method to use for the uninstallation.
| Property | Value |
|---|---|
| Type: | DeploymentMethod |
| Enum values: | Setup, Copy, MSI, InnoSetup, Nullsoft, BitRockInstaller, Burn, AppX |
| Position: | Named |
| Default value: | Setup |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The arguments to pass to the uninstaller.
If not specified, the default arguments for the method will be used.
Be aware that arguments are automatically escaped to ensure that they are properly formatted for the process start.
Manual escaping will be passed as a literal string to the process.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The additional arguments to pass to the uninstaller.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The package directory to use for the uninstallation.
| Property | Value |
|---|---|
| Type: | DirectoryInfo |
| Position: | Named |
| Default value: | (& $script:CommandTable.'Get-ADTSession').NXT.Package.Directory |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Optional awaiter objects that should be evaluated post uninstallation.
| Property | Value |
|---|---|
| Type: | INxtAwaiter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The path to the log file ending with a .log extension.
This file will reside in the log directory of the ADT session.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | ID.$deploymentTimestamp.log |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The exit codes that indicate a successful uninstallation.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | - Defaults depend on the method and session configuration. |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The exit codes that indicate a reboot is required after the uninstallation.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | - Defaults depend on the method and session configuration. |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if the function should ignore exit codes and not treat them as errors.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The session will be immediatly closed if the execution fails.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if the function should avoid using cached uninstaller files.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Update the deployment exit code according to parameters.
Update-NXTDeploymentStatus
[-ExitCode] <int>
[-ADTSession <NxtDeploymentSession>]
[-SuccessExitCodes <int[]>]
[-RebootExitCodes <int[]>]
[<CommonParameters>]
Update the deployment exit code according to parameters.
An update is only applied if the provided code will either keep or degrade the deployment status to a higher value.
Order: Complete > Restart > FastRetry > Error
If required, the input code will be translated into a maching session exit code.
NOTE
This function is born to the missing implementation of PSADT 4.1.8.
The behaviour of this function is baked into PSADT 4.2+ functions by default.
This function does not take any pipeline input.
This function does not return any output.
The exit code to update the session with.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Codes that would be considered successful.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Codes that would indicate a reboot is required.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The current deployment session to update the status for.
| Property | Value |
|---|---|
| Type: | NxtDeploymentSession |
| Position: | Named |
| Default value: | (& $script:CommandTable.'Get-ADTSession') |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Invokes the session's application detection and updates the detection status accordingly.
Update-NXTDetectionStatus
[[-ADTSession] <NxtDeploymentSession>]
[<CommonParameters>]
The Update-NXTDetectionStatus function checks the session's application detection criteria and updates the detection status based on the results.
It sets the IsInstalled property to true if the application is found, false if not found, and updates the VersionStatus property based on the comparison with the TargetVersion.
Update-NXTDetectionStatus -ADTSession $adtSession
This function does not take any pipeline input.
This function does not return any output.
The NxtDeploymentSession object representing the current deployment session. If not provided, the function will attempt to retrieve the current session using Get-ADTSession.
| Property | Value |
|---|---|
| Type: | NxtDeploymentSession |
| Position: | 0 |
| Default value: | (& $script:CommandTable.'Get-ADTSession') |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Updates text within a file by replacing specified strings.
# ParameterSet Path
Update-NXTTextInFile
[-Path] <string[]>
[-Query] <string>
[-Value] <string>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Regex]
[-CaseSensitive]
[-Count <uint32>]
[-Encoding <Encoding>]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
# ParameterSet LiteralPath
Update-NXTTextInFile
[-Query] <string>
[-Value] <string>
-LiteralPath <string[]>
[-Filter <string>]
[-Exclude <string[]>]
[-Include <string[]>]
[-Regex]
[-CaseSensitive]
[-Count <uint32>]
[-Encoding <Encoding>]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
This cmdlet allows you to replace specific text in a file. It searches for a given string and replaces it with another string.
The function can target a specific number of occurrences and use various encoding options.
Update-NXTTextInFile -Path 'C:\Temp\test.txt' -Query 'Hello' -Value 'Hi'
Updates the text 'Hello' to 'Hi' in the file 'C:\Temp\test.txt'.
System.String - The value to replace the query string with.
This function does not return any output.
The path to the file(s) to update.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The literal path to the file(s) to update.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
A filter to qualify the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to exclude items from the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
A filter to include items in the Path parameter.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
The string to search for in the file(s).
| Property | Value |
|---|---|
| Type: | String |
| Position: | 1 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The string to replace the query string with.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 2 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue) |
| Accept wildcard characters: | False |
Indicates that the query string is a regular expression.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Indicates that the search should be case-sensitive.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The maximum number of occurrences to replace.
| Property | Value |
|---|---|
| Type: | UInt32 |
| Position: | Named |
| Default value: | System.Int32::MaxValue |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The encoding to use when reading and writing the file. If not specified, the encoding will be detected from the file.
| Property | Value |
|---|---|
| Type: | Encoding |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Determines if hidden files should be processed or if the Read-Only attribute should be ignored when setting the content of the file.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Wait until a file is no longer in use by another process.
Wait-NXTFileNotInUse
[-Path] <string>
[-Timeout <timespan>]
[-Interval <timespan>]
[-PassThru]
[-IsInUse]
[<CommonParameters>]
Wait until a file is no longer in use by another process.
NOTE
With the -IsInUse switch, the test will be inverted.
Wait-NXTFileNotInUse -Path 'C:\Temp\file.txt' -Timeout '00:02:00'
Wait until the file 'C:\Temp\file.txt' is no longer in use by another process or until the timeout of 120 seconds is reached.
System.IO.FileInfo - The file to check.
System.Boolean - Returns $true if the file is no longer in use; otherwise, returns $false.
System.IO.FileSystemInfo - Returns the file system object when -PassThru is specified.
The path to the file to check.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The maximum time to wait for the file to be released.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | Named |
| Default value: | 00:01:00 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The interval at which to check for the file's usage status.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | Named |
| Default value: | 00:00:01.000 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Instead of returning a boolean, return the object.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Instead of checking whether the file is not in use, check whether it is in use.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Monitors the presence of a specified filesystem path within a set timeout period.
Wait-NXTFileSystem
[-Path] <string>
[-Timeout <timespan>]
[-Interval <timespan>]
[-PassThru]
[-IsRemoved]
[<CommonParameters>]
This function checks for the existence of a specified file or folder within a given time frame.
The function also supports the resolution of CMD environment variables in the filesystem path.
NOTE
With the -IsRemoved switch, the test will be inverted.
Wait-NXTFileSystem -Path "C:\Temp\Sources\Installer.exe" -Timeout '00:02:00'
Monitors for 'Installer.exe' in the specified directory and waits up to 120 seconds for it to appear.
Wait-NXTFileSystem -Path "C:\Temp\Sources\Installer.exe" -Timeout '00:02:00' -IsRemoved
Monitors for 'Installer.exe' in the specified directory and waits up to 120 seconds for it to disappear.
System.IO.FileSystemInfo - The filesystem object to monitor.
System.Boolean - Returns $true if the path appears within the timeout period; otherwise, returns $false.
System.IO.FileSystemInfo - Returns the file system object when -PassThru is specified.
The path to the file or directory to monitor.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The maximum time to wait for the path to appear or disappear.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | Named |
| Default value: | 00:01:00 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The interval at which to check for the path's presence or removal.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | Named |
| Default value: | 00:00:01.000 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Instead of returning a boolean, return the object.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Instead of checking for the presence of the path, check for its removal.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Monitors the startup of a specified process within a set timeout period.
# ParameterSet Name
Wait-NXTProcess
[-Name] <string>
[-Timeout <timespan>]
[-Interval <timespan>]
[-PassThru]
[-IsStopped]
[<CommonParameters>]
# ParameterSet Id
Wait-NXTProcess
-Id <int>
[-Timeout <timespan>]
[-Interval <timespan>]
[-PassThru]
[-IsStopped]
[<CommonParameters>]
# ParameterSet ProcessDefinition
Wait-NXTProcess
-ProcessDefinition <ProcessDefinition>
[-Timeout <timespan>]
[-Interval <timespan>]
[-PassThru]
[-IsStopped]
[<CommonParameters>]
This function checks for the startup of a process.
The function continuously checks for the process's presence until it starts or stops or the timeout is reached.
NOTE
With the -IsStopped switch, the test will be inverted.
Wait-NXTProcess -Name "notepad.exe" -Timeout '00:02:00'
Monitors for 'notepad.exe' to start and waits up to 120 seconds for it to appear.
Wait-NXTProcess -Name "notepad.exe" -Timeout '00:02:00' -IsStopped
This example monitors for 'notepad.exe' and waits up to 120 seconds for it to stop.
System.String - The name of the process to monitor.
System.Int32 - The process ID to monitor.
System.Diagnostics.Process - The process to monitor.
Microsoft.Management.Infrastructure.CimInstance - The Win32_Process cim instance to monitor.
PSADT.ProcessManagement.ProcessDefinition - The process definition to monitor.
PSADTNXT.ProcessManagement.NxtCloseProcess - The process definition to stop.
System.Boolean - Returns $true if the process starts within the timeout period; otherwise, returns $false.
System.Diagnostics.Process - Returns the process when -PassThru is specified.
The name of the process to monitor.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The ID of the process to monitor.
| Property | Value |
|---|---|
| Type: | Int32 |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
The process definition to monitor.
| Property | Value |
|---|---|
| Type: | ProcessDefinition |
| Position: | Named |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByValue, ByPropertyName) |
| Accept wildcard characters: | False |
The maximum time to wait for the process to start or stop.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | Named |
| Default value: | 00:01:00 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The interval at which to check for the process's presence or disappearance.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | Named |
| Default value: | 00:00:01.000 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Instead of returning a boolean, return the object.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Instead of checking for the presence of the process, check for its disappearance.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Watches a specified registry key for its existence for a given duration.
Wait-NXTRegistryKey
[-Key] <string>
[-KeyName <string>]
[-KeyValue <string>]
[-Wow6432Node]
[-Timeout <timespan>]
[-Interval <timespan>]
[-PassThru]
[-IsRemoved]
[<CommonParameters>]
This command monitors a specified registry key and checks for its existence within a defined timeout period.
It is useful for scenarios where the presence or absence of a registry key is required for certain processes or checks.
NOTE
With the -IsRemoved switch, the test will be inverted.
Wait-NXTRegistryKey -Key "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Teams"
This example monitors the specified registry key and waits up to 60 seconds to check its existence.
Wait-NXTRegistryKey -Key "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Teams" -IsRemoved
This example monitors the specified registry key and waits up to 60 seconds to check its existence has ended.
Microsoft.Win32.RegistryKey - The registry key to monitor.
System.Boolean - Returns $true if the registry key exist within the timeout period; otherwise, returns $false.
PSCustomObject - Returns the registry key values as custom object when -PassThru is specified.
The path to the registry key to monitor.
| Property | Value |
|---|---|
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Required: | True |
| Accept pipeline input: | True (ByPropertyName) |
| Accept wildcard characters: | False |
The name of the registry key to monitor.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The value of the registry key to monitor.
| Property | Value |
|---|---|
| Type: | String |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies that the registry key is located in the Wow6432Node.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The maximum time to wait for the registry key to be created or removed.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | Named |
| Default value: | 00:01:00 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The interval at which to check for the registry key's presence or removal.
| Property | Value |
|---|---|
| Type: | TimeSpan |
| Position: | Named |
| Default value: | 00:00:01.000 |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Instead of returning a boolean, return the object containing the properties.
If no properties exist, the key itself is returned.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Instead of checking for the presence of the registry key, check for its removal.
| Property | Value |
|---|---|
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Required: | False |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |