Rootctl
Windows
List
Transcript Logging
Transcript Logging
How to run a PowerShell script without displaying a window?You can either run it like this (but this shows a windows for a while):
-----------------------------------------------------------------------------------------------------------------------------------
PowerShell.exe -windowstyle hidden { your script.. }
powershell.exe -command “& ‘C:\Users\Adminn\Desktop\test.ps1’ ‘C:\list.txt’ “
PowerShell.exe -ExecutionPolicy ByPass -File export-logs.ps1
##########Transcript Logging##########
enable the Turn on PowerShell Transcription Group Policy setting
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\PowerShell\Transcription
Configure the policy value for Computer Configuration >> Administrative Templates >> Windows Components >> Windows PowerShell >> "Turn on PowerShell Transcription" to "Enabled".
Registry Hive: HKEY_LOCAL_MACHINE
Registry Path: \SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription\
Value Name: EnableTranscripting
Value Type: REG_DWORD
Value: 1
##########Set up a Windows system for logging below two :
New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" -Force
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" -Name "EnableScriptBlockLogging" -Value 1 -Force
Start-Transcript -path c:\Temp\MyTranscript.txt
Start-Transcript -Path c:\Temp\MyTranscript.txt -Append
.