This repository has been archived by the owner on Jun 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d779d48
commit 835a41e
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
||
"<?xml version=""1.0"" encoding=""utf-8""?>" | Out-File $firstExportPath -Append utf8 | ||
|
||
"<Jobs xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://jams.mvpsi.com/v1"">" | Out-File $firstExportPath -Append utf8 | ||
|
||
foreach($obj in $jobList) | ||
{ | ||
if ($obj -is [MVPSI.JAMS.Job]) | ||
{ | ||
"<Job name=""{0}"">" -f $obj.JobName | Out-File $firstExportPath -Append utf8 | ||
"</Job>" | Out-File $firstExportPath -Append utf8 | ||
} | ||
} | ||
"</Jobs>" | Out-File $firstExportPath -Append utf8 | ||
$secondExportPath = "C:\Users\TimF.MVP\Desktop\SUPPORT\SecondExport.xml" | ||
|
||
Export-JAMSXml -InputObject $jobList -Path $secondExportPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |