diff --git a/ExportScript.ps1 b/ExportScript.ps1 new file mode 100644 index 0000000..3544fa5 --- /dev/null +++ b/ExportScript.ps1 @@ -0,0 +1,36 @@ +# +# The Folder to export from +# +$targetFolder = "Samples\TestFolder" + +# +# Add the JAMS module +# +Import-Module JAMS + +# +# Set the path of the first export which will just export job names and empty properties +# +$firstExportPath = "C:\Users\TimF.MVP\Desktop\SUPPORT\FirstExport.xml" + +# +# Get Jobs in the specified Folder recursively +# +$jobList = Get-ChildItem JAMS::localhost\$targetFolder\* #-Recurse + +"" | Out-File $firstExportPath -Append utf8 + +"" | Out-File $firstExportPath -Append utf8 + +foreach($obj in $jobList) +{ + if ($obj -is [MVPSI.JAMS.Job]) + { + "" -f $obj.JobName | Out-File $firstExportPath -Append utf8 + "" | Out-File $firstExportPath -Append utf8 + } +} +"" | Out-File $firstExportPath -Append utf8 +$secondExportPath = "C:\Users\TimF.MVP\Desktop\SUPPORT\SecondExport.xml" + +Export-JAMSXml -InputObject $jobList -Path $secondExportPath \ No newline at end of file diff --git a/ImportScript.ps1 b/ImportScript.ps1 new file mode 100644 index 0000000..11fbd57 --- /dev/null +++ b/ImportScript.ps1 @@ -0,0 +1,3 @@ +Import-Module JAMS + +Import-JAMSXml -Path "The path to your import file." -TargetFolder "Your folder path in JAMS goes here" -Server "Your server goes here"