Skip to content

Update ActiveDirectoryTools.psm1#1

Open
TerAnYu wants to merge 1 commit into
bamcisnetworks:masterfrom
TerAnYu:patch-1
Open

Update ActiveDirectoryTools.psm1#1
TerAnYu wants to merge 1 commit into
bamcisnetworks:masterfrom
TerAnYu:patch-1

Conversation

@TerAnYu

@TerAnYu TerAnYu commented Feb 22, 2019

Copy link
Copy Markdown

Delete Push-Location -Path "$Drive`\" which leads to an error

Delete ```Push-Location -Path "$Drive`\"``` which leads to an error
@hakenmt

hakenmt commented Feb 22, 2019

Copy link
Copy Markdown
Contributor

The PSDrive usage here is so that you can remotely manage ACLs in Active Directory, since you need to reference the path. What error are you getting from the Push-Location cmdlet?

@TerAnYu

TerAnYu commented Feb 23, 2019

Copy link
Copy Markdown
Author

In the GPPermissions.json file there are Cyrillic symbols. The file itself is in 1251 encoding.
Import-GPOPermissionsFromJson .\GPPermissions.json
I tried to change the encoding on UTF8 with BOM

Get-Content : Не удается найти параметр, соответствующий имени параметра "Raw".
C:\Users\a.teremshonok\Desktop\Desktop\gpo\ActiveDirectoryDomainServices-master\Backups\ActiveDirectoryTools-master\ActiveDirectoryTools\ActiveDirectoryTools.psm1:257 знак:73
+ ... = ConvertFrom-Json -InputObject (Get-Content -Path $Path -Raw @CredSp ...
+                                                              ~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Content], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand

I cannot display an English-language error, there is no such system.

Get-Content : A parameter cannot be found that matches parameter name "Raw".

@hakenmt

hakenmt commented Feb 23, 2019

Copy link
Copy Markdown
Contributor

You can see here that -Raw is a standard parameter for the Get-Content cmdlet. What version of PowerShell are you using?

@TerAnYu

TerAnYu commented Feb 23, 2019

Copy link
Copy Markdown
Author

I tried different options, but deleting or commenting on Push-Location -Path "$ Drive` \" leads to trouble-free work.

PS C:\> Get-Host


Name             : ConsoleHost
Version          : 5.1.17134.407
InstanceId       : dd62f71b-4b5b-4f18-b6e6-1e9e1a8b3e20
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : ru-RU
CurrentUICulture : ru-RU
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants