I had to change line 239 to : Add-Type -ErrorAction Stop -Language:CSharp -TypeDefinition $CSharpCode change from CSharpVersion3 to CSharp I got error Compiler executable file csc.exe cannot be found Found solution here https://github. com/proxb/PoshR SJob/issues/23 After this it worked (even if I changed the code back to CSharpVersion3 ) Now it works like a charm. Should the code be updated?
Hi, I am trying to use this script .\Add-UserToLoginAsBatch.ps1 "domain\usernam e" This does nothing! Even Write-Host Statements are not working. How do I make this work?
By having a look at the actual code you pleb. The script contains a function which means it needs to be dot-sourced like this: . .\Add-UserToLoginAsBatch.ps1 Then use the function as follows: Add-UserToLogin AsBatch.ps1 -UserID "domain\usernam e"
(Fixed copy/paste error) Then use the function as follows: Add-UserToLoginAsBatch -UserID "domain\usernam e"