Skip to content

Instantly share code, notes, and snippets.

@cajones
Created March 23, 2012 10:38
Show Gist options
  • Save cajones/2169460 to your computer and use it in GitHub Desktop.
Save cajones/2169460 to your computer and use it in GitHub Desktop.
Powershell script to flatten a folder structure from Adobe Captivate
param($directoryToFlatten = '.', $scormSubDir = 'SCORM_support')
$supportDir = "$directoryToFlatten\$scormSubDir"
if((Test-Path $supportDir)) {
mi "$supportDir\*.*" $directoryToFlatten
ri $supportDir
Write-Host 'Support files moved...'
}
$htmlContent = gc "$directoryToFlatten\sco.htm"
$htmlContent |% { $_ -replace "$scormSubDir/", "" } | sc "$directoryToFlatten\sco.htm"
Write-Host 'HTML content updated...'
$xmlContent = gc "$directoryToFlatten\imsmanifest.xml"
$xmlContent |% { $_ -replace "$scormSubDir/", "" } | sc "$directoryToFlatten\imsmanifest.xml"
Write-Host 'XML content updated...'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment