Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Defining remote and local path to folders with presentation
- $RemotePath = $share
- $LocalPath = C:\ppt
- #Defining powerpoint aplication and environment variables
- $soubor = Get-ChildItem $LocalPath -File
- $ppt = ($Soubor | Select-Object FullName)
- $RemFile = (Get-ChildItem $RemotePath -file)
- $LocFile = (Get-ChildItem $LocalPath -File)
- "
- $RemotePath shows $RemFile files to copy
- "
- "-----------------------------------------------------"
- #Checking date and then copying file from RemotePath to LocalPath
- foreach ($file in $RemFile) {
- Copy-Item -Path $file.fullname -Destination $LocalPath -Recurse
- " [*] $file "
- }
- "
- $LocalPath shows $Locfile to run
- "
- Write-Output $ppt
- foreach ($file in $soubor) {
- $Application = New-Object -ComObject PowerPoint.Application
- $ppSlideShowDone = 5
- $ppAdvanceOnTime = 2
- $pres = $Application.Presentations.Open($file.name)
- $pres.SlideShowSettings.Run()
- $pres.SlideShowSettings.AdvanceMode = $ppAdvanceOnTime
- $Pres.SlideShowSettings.StartingSlide = 1
- $pres.SlideShowSettings.EndingSlide = $pres.Slides.Count
- do {
- Start-Sleep -second 2
- } until ($pres.SlideShowSettings.Run.View.State -eq $ppSlideShowDone)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement