Invoke-FluxDataShareProcessReady
SYNOPSIS
Invokes the external processes that are ready to run for a DataShare operation.
SYNTAX
Invoke-FluxDataShareProcessReady
-ProcessesReady <System.Collections.Generic.List`1[Flux.Hive.ServiceModel.DataShare.Process.ProcessReady]>
[-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Executes each ready process in a ProcessReady list and returns a DataShareProcessLog entry per
process.
Each ProcessReady entry specifies:
- WorkingDirectory — the directory the process is launched from; relative paths in
Argumentsresolve against this. - FileName — the executable to run, resolved via
PATH(e.g.ogr2ogr.exe).
To run a PowerShell script, setFileNametopwsh.exeorpowershell.exeand pass the script using the-Fileparameter inArguments(e.g.-NonInteractive -NoProfile -File ./script.ps1 arg1). The path in-Filecan be relative toWorkingDirectory. - Arguments — the arguments passed to the executable.
The GDAL environment (GDAL_DATA, GDAL_DRIVER_PATH, PROJ_LIB) and the GDAL bin directories are
automatically added to the process environment so tools such as ogr2ogr.exe are resolved via PATH.
EXAMPLES
Example 1 — ogr2ogr.exe
$ProcessesReady = Get-FluxDataShareProcessReady -HiveApplication $HiveApplication
$Processes = Invoke-FluxDataShareProcessReady -ProcessesReady $ProcessesReady
Retrieves all processes that are ready to run and invokes them. Each entry in $ProcessesReady is
expected to have FileName set to an executable such as ogr2ogr.exe that is resolved via PATH.
Example 2 — PowerShell script via pwsh.exe
$ProcessReady = [Flux.Hive.Application.PowerShell.Models.DataShare.ProcessReady]@{
OrderId = '123'
SchemaName = 'dbo'
TableName = 'my_table'
WorkingDirectory = 'E:\Flux\PowerShell\GISDB2020'
FileName = 'pwsh.exe'
Arguments = '-NonInteractive -NoProfile -File ./import.ps1 arg1'
}
$Processes = Invoke-FluxDataShareProcessReady -ProcessesReady @( $ProcessReady )
Invokes a PowerShell script by specifying pwsh.exe (or powershell.exe) as FileName and
providing the script path via -File in Arguments. The script path is relative to
WorkingDirectory.
PARAMETERS
-ProcessesReady
DataShare Processes that are Ready to run
Type: System.Collections.Generic.List`1[Flux.Hive.ServiceModel.DataShare.Process.ProcessReady]
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-ProgressAction
{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.