Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
TFinnerty22 authored Sep 15, 2017
1 parent d779d48 commit 835a41e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
36 changes: 36 additions & 0 deletions ExportScript.ps1
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
3 changes: 3 additions & 0 deletions ImportScript.ps1
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"

0 comments on commit 835a41e

Please sign in to comment.