Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. DPC18WWQ6BT602AB0
  2. ....
  3.  
  4. AG_DPC18WWQ6BT602-A1.job
  5.  
  6. [Automatoin]
  7. Process=Auto
  8. PO=D:POfiles
  9.  
  10. [BIDINFO]
  11. BID=18WWQ6BT602
  12. PFX=DPC
  13. CRM=A1
  14.  
  15. $PO_Path = $Config_File.Automation_Config.Path.POfiles
  16. $Job_Path = $Config_File.Automation_Config.Path.JOB
  17. if(SWPO_Map -eq $true)
  18. {
  19. Write-Host ">>Get SWPO Files"
  20. $PO_Content = Get-Content -path $PO_Path*
  21. $POfile = Get-ChildItem -Name $PO_Path
  22. $FilteredContents = $PO_Content | Where-Object {$_ -like "*;CRM*"}
  23. $CRM = $FilteredContents.Substring(5,2)
  24.  
  25. $Count = 1
  26. Foreach ($POfile in $PO_Path)
  27. {
  28. Foreach($CRM in $CRM){
  29. try {
  30. New-Item -ItemType File -Path "$Job_PathAG_$Prefix$BID-$CRM.job" -Force
  31. $Output_JOB = "[Automatoin]", "Process=Auto","PO=$POfile", " ", "[BIDINFO]", "BID=$BID", "PFX=$Prefix", "CRM=$CRM" | Out-File "$Job_PathAG_$Prefix$BID-$CRM.job" -Encoding oem
  32. $Count += 1
  33. }
  34. catch {
  35. Write-Host "NO CRM"
  36. }
  37. }
  38. }
  39. }
  40. else
  41. {
  42. Write-Host "SWPO Not Found"
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement