#VARIABLES
$Source = Read-host "Please provide DIR location you wish to copy its contents from.
ie. (UNC, Absolute paths, etc)"
$Serverlist = Read-Host "Please provide the location of the server list. (UNC, Absolute
paths, etc)"
$Servers = Get-Content -Path $Serverlist
#$Destination1 = \\$Server\c$\inetpub\wwwroot\'
#$Destination2 = \\$Server\c$\wmpub\wmroot\'
#EXECUTION
$Servers | foreach-object {
Copy-Item -Path $Source*.wsx -Destination $Server\c$\inetpub\wwwroot\ -
force
Copy-Item -Path $Source*.nsc -Destination $Server\c$\wmpub\wmroot\ -force
}
#EVENTVWR LOGGING
$EventLog = New-Object System.Diagnostics.EventLog('Application')
$EventLog.MachineName = "."
$EventLog.Source = "Streaming Media Engineering"
$EventLog.WriteEntry('Copy Successful',"Information", 200)
#VIEWING OVERLOADS
($myevent.WriteEntry).OverloadDefinitions
Add-Type -AssemblyName System.Speech
$synthesizer = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$synthesizer.Speak('Files have been moved over successfully...')
Copy-Item ループを実行しようとすると、スクリプトで $Destination1 および $Destination2 パスの $Server 変数を読み取ることができないようです。これに数日を費やしたのを助けてください...