Last active
February 11, 2023 10:00
-
-
Save kilasuit/e7c276ca67929ae54369f726877dab08 to your computer and use it in GitHub Desktop.
Enable-OverTheShoulderPSTranscription is a function that you can run to set the registry keys that Force
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Enable-OverTheShoulderPSTranscription { | |
$basePath = "HKLM:\Software\Policies\Microsoft\PowerShellCore\Transcription" | |
if(-not (Test-Path $basePath)) { $null = New-Item $basePath -Force } | |
Set-ItemProperty $basePath -Name EnableTranscripting -Value 1 | |
Set-ItemProperty $basePath -Name OutputDirectory -Value "$env:USERPROFILE\OneDrive\PSTranscripts\$env:COMPUTERNAME\PSCore\" | |
Set-ItemProperty $basePath -Name EnableInvocationHeader -Value 1 | |
$basePath = "HKLM:\Software\Policies\Microsoft\Windows\PowerShell\Transcription" | |
if(-not (Test-Path $basePath)) { $null = New-Item $basePath -Force } | |
Set-ItemProperty $basePath -Name EnableTranscripting -Value 1 | |
Set-ItemProperty $basePath -Name OutputDirectory -Value "$env:USERPROFILE\OneDrive\PSTranscripts\$env:COMPUTERNAME\" | |
Set-ItemProperty $basePath -Name EnableInvocationHeader -Value 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"Microsoft.PowerShell:ExecutionPolicy":"RemoteSigned", | |
"PowerShellPolicies": { | |
"Transcription": { | |
"EnableTranscripting": true, | |
"EnableInvocationHeader": true, | |
"OutputDirectory": "C:\\tmp\\" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment