Its some how not working. Here is the log file output.
But If i login to the machine and open powershell runas administrator its working
Transcript started, output file is C:\Users\ha230100\Desktop\log.txt
New-ItemProperty : Requested registry access is not allowed.
At line:2 char:1
+ New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (HKEY_LOCAL_MACH...policies\system:String) [New-ItemProperty],
SecurityException
+ FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.NewItemPropertyCommand
New-ItemProperty : Requested registry access is not allowed.
At line:2 char:1
+ New-ItemProperty -Path HKLM:Software\Microsoft\Windows\CurrentVersion ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : PermissionDenied: (HKEY_LOCAL_MACH...policies\system:String) [New-I
temProperty], SecurityException
+ FullyQualifiedErrorId : System.Security.SecurityException,Microsoft.PowerShell.Commands.New
ItemPropertyCommand
**********************
Windows PowerShell transcript end
End time: 20190213003035
**********************