Skip to main content
spelling
Source Link
Jason Aller
  • 3.7k
  • 28
  • 42
  • 40

How to redirect powershellPowerShell output within batch file ( when run from Task Scheduler)?

i'mI'm running a batch file from Task Scheduler wich i excecutewhich I execute a PowershellPowerShell Scripts. So  , iI have a batch file (TestFD.bat)  :

Powershell -Command "& {C:\Users\csadouni\Desktop\testFDCOMM.ps1}" > logFDCOM.txt 

My script powershell doPowerShell does migration of my documents on my SharePoint Online site and it's work well (the log file is genratedgenerated perfectly) if iI call the batch file from cmd.exe. Then From the task Windows heit work well but the issue seem on task windows doesn't recognize my output file redirection. So no file generated

I tried all thosesthese solutions  , but no one resolve my issue.

How can I redirect PowerShell output when run from Task Scheduler?

Executing PowerShell from Windows Task Scheduler

How do I execute a PowerShell script automatically using Windows task scheduler?

I wouldn't running only my PSscript directly from Scheduler Task  , beacuse ibecause I need my output redirection of my Sharegate transfer (Sharegate is a product to automate task  , manage  , adminsteradminister and migtratemigrate site  , content on SharePoint & Office 365)  , So  , iI need my output of PowershellPowerShell migration after iI have many other scripts to schedule them on my batch file. What am I missing?

Any help it'sis appreciated thanks  !

How to redirect powershell output within batch file ( when run from Task Scheduler)?

i'm running a batch file from Task Scheduler wich i excecute a Powershell Scripts. So  , i have a batch file (TestFD.bat)  :

Powershell -Command "& {C:\Users\csadouni\Desktop\testFDCOMM.ps1}" > logFDCOM.txt 

My script powershell do migration of my documents on my SharePoint Online site and it's work well (the log file is genrated perfectly) if i call the batch file from cmd.exe. Then From the task Windows he work well but the issue seem on task windows doesn't recognize my output file redirection. So no file generated

I tried all thoses solutions  , but no one resolve my issue.

How can I redirect PowerShell output when run from Task Scheduler?

Executing PowerShell from Windows Task Scheduler

How do I execute a PowerShell script automatically using Windows task scheduler?

I wouldn't running only my PSscript directly from Scheduler Task  , beacuse i need my output redirection of my Sharegate transfer (Sharegate is a product to automate task  , manage  , adminster and migtrate site  , content on SharePoint & Office 365)  , So  , i need my output of Powershell migration after i have many other scripts to schedule them on my batch file. What am I missing?

Any help it's appreciated thanks  !

How to redirect PowerShell output within batch file ( when run from Task Scheduler)?

I'm running a batch file from Task Scheduler which I execute a PowerShell Scripts. So, I have a batch file (TestFD.bat):

Powershell -Command "& {C:\Users\csadouni\Desktop\testFDCOMM.ps1}" > logFDCOM.txt 

My script PowerShell does migration of my documents on my SharePoint Online site and it's work well (the log file is generated perfectly) if I call the batch file from cmd.exe. Then From the task Windows it work well but the issue seem on task windows doesn't recognize my output file redirection. So no file generated

I tried all these solutions, but no one resolve my issue.

How can I redirect PowerShell output when run from Task Scheduler?

Executing PowerShell from Windows Task Scheduler

How do I execute a PowerShell script automatically using Windows task scheduler?

I wouldn't running only my PSscript directly from Scheduler Task, because I need my output redirection of my Sharegate transfer (Sharegate is a product to automate task, manage, administer and migrate site, content on SharePoint & Office 365), So, I need my output of PowerShell migration after I have many other scripts to schedule them on my batch file. What am I missing?

Any help is appreciated thanks!

Source Link

How to redirect powershell output within batch file ( when run from Task Scheduler)?

i'm running a batch file from Task Scheduler wich i excecute a Powershell Scripts. So , i have a batch file (TestFD.bat) :

Powershell -Command "& {C:\Users\csadouni\Desktop\testFDCOMM.ps1}" > logFDCOM.txt 

My script powershell do migration of my documents on my SharePoint Online site and it's work well (the log file is genrated perfectly) if i call the batch file from cmd.exe. Then From the task Windows he work well but the issue seem on task windows doesn't recognize my output file redirection. So no file generated

I tried all thoses solutions , but no one resolve my issue.

How can I redirect PowerShell output when run from Task Scheduler?

Executing PowerShell from Windows Task Scheduler

How do I execute a PowerShell script automatically using Windows task scheduler?

I wouldn't running only my PSscript directly from Scheduler Task , beacuse i need my output redirection of my Sharegate transfer (Sharegate is a product to automate task , manage , adminster and migtrate site , content on SharePoint & Office 365) , So , i need my output of Powershell migration after i have many other scripts to schedule them on my batch file. What am I missing?

Any help it's appreciated thanks !