Disable PowerShell logging files

%3CLINGO-SUB%20id%3D%22lingo-sub-1309194%22%20slang%3D%22en-US%22%3EDisable%20PowerShell%20logging%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1309194%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20noticed%20that%20Powershell%20is%20logging%20files%20(Office365Powershell_20200316090129.txt)%20at%20C%3A%5CUsers%5C%3CALIAS%3E%5CAppData%5CLocal%5CMicrosoft%5COffice365%5CPowershell.%20These%20seems%20to%20be%20generated%20by%20Powershell%20for%20diagnostic%20purposes.%3C%2FALIAS%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20we%20disable%20generation%20of%20these%20files%3F%20I%20am%20hoping%20to%20run%20some%20cmdlet%20or%20set%20some%20parameter%20to%20achieve%20the%20same.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%2C%3C%2FP%3E%3CP%3EBhavpreet%20Bains%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1309194%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1309776%22%20slang%3D%22en-US%22%3ERe%3A%20Disable%20PowerShell%20logging%20files%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1309776%22%20slang%3D%22en-US%22%3E%3CP%3EThat's%20only%20for%20the%20MSOnline%20module%2C%20not%20PowerShell%20in%20general.%20But%20no%2C%20afaik%20there%20is%20no%20way%20to%20disable%20the%20logs.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

Hello,

 

We have noticed that Powershell is logging files (Office365Powershell_20200316090129.txt) at C:\Users\<alias>\AppData\Local\Microsoft\Office365\Powershell. These seems to be generated by Powershell for diagnostic purposes.

 

How can we disable generation of these files? I am hoping to run some cmdlet or set some parameter to achieve the same.

 

Thank you,

Bhavpreet Bains

1 Reply

That's only for the MSOnline module, not PowerShell in general. But no, afaik there is no way to disable the logs.