With powerJobs v16.1 there were some core changes to have a more flexible powerJobs. New cmdlets were introduced, therefore when updating from earlier versions (e.g. powerJobs 2014, 2015, 2015R2 or 2016) some manual steps are required.


The upgrade and usage for the deprecated functions is only supported for powerJobs v17 and earlier.


Manual steps

For jobs to run with a newer powerJobs version perform following steps:

  1. When updating from versions earlier than 16.1 it is recommended to uninstall the old powerJobs before installing the newer version. Please remember to backup your jobs before.
  2. Download the upgrade module from the attachments and copy the content into the powerJobs modules (“C:\ProgramData\coolOrange\powerJobs\Modules"). This module wraps the old cmdlets so that they still work with the newer powerJobs version.

Now the old jobs should run out of the box with the newer powerJobs version.


Manual adjustments

If you are still experiencing problems with the jobs after performing the steps above here is a list of the replaced cmdlets. You can replace the code manually if it is used in a job:

#Replace cmdlet
IsTrueViewInstalled

#With
$trueView = Get-Application 'DWG TrueView' 
$trueView.IsInstalled


#Replace cmdlet
IsAutoCadInstalled

#With
[System.Type]::GetTypeFromProgID("AutoCAD.Application") -ne $null


#Replace cmdlet
IsInventorInstalled

#With
$inventor=Get-Application 'Inventor'
$inventor.IsInstalled


#Replace cmdlet
IsInventorDwg

#With
if(Open-Document -LocalFile $fullFilePath -Application 'Inventor') {
  ...
}

#or
$opened = Open-Document -LocalFile $fullFilePath
if($opened.Application.Name -eq 'Inventor') {
   ...
}


#Replace cmdlet
SaveAsWithOptions

#With
Open-Document -LocalFile $fullFilePath
Export-Document -Format ... -Options $translatorOptions

When exporting Inventor documents with formats that use the TranslatorAddin, -Options will be used as TranslatorOptions.


$powerJobs.Log

#If your Job is using $powerJobs.Log before PrepareEnvironment, #PrepareEnvironmentForFile
#or PrepareEnvironmentForFolder is called, please remove the log or move it down after #the PrepareEnvironment line.


$SysProps

#If your Job is using $SysProps before PrepareEnvironment, PrepareEnvironmentForFile
#or PrepareEnvironmentForFolder is called, please move it down after the #PrepareEnvironment line.


Save-As

All the Save-As functions are using the default ini/dwg export configuration file for the export. These are the same files used by the sample jobs. In case the default ini/dwg were customized they will have to replace the new ones


TrueViewSetup.dwg

If you have customized Modules\Publish\TrueViewSetup.dwg from previous powerJobs Version then you have to replace the following files, depnding on your export format:

  • PDF: Modules\Export\PDF.dwg
  • DWF: Modules\Export\DWF.dwg

The configuration files are used in the functions SaveAs_DWF and SaveAs_PDF.


DXF_config.ini

If you have customized Modules\Publish\DXF_config.ini from previous powerJobs Version then you have to replace the file Modules\Export\DXF_2D.ini.

The configuration file is used in the SaveAs_DXF function.


SheetDXF

If you had special options when creating SheetDXF then you have to apply these settings to the Modules\Export\DXF_SheetMetal.ini. In earlier versions the options where directly used in the code:

$options = "FLAT PATTERN DXF?AcadVersion=2000&BendLayer=0&OuterProfileLayer=0&InvisibleLayers=IV_TANGENT;IV_BEND;IV_ARC_CENTERS;IV_BEND_DOWN;IV_INTERIOR_PROFILES"


When using IGES conversion, please note that in previous powerJobs functions this format was only supported for AutoCad files, but now it is replaced with Inventor 3D document support.


AutoCAD

In case you did remove the flag -UseTrueView in function SaveAs_PDF or SaveAs_DWF, AutoCad was used instead of TrueView for the export in earlier versions. Since AutoCad is not available in default powerJobs Applications, only PDF and DWF / DWFX files can be converted via TrueView for AutoCad files.

However AutoCad support can still be added via following workaround:Working with AutoCAD API.