← All posts tagged powershell

otakuSiD
iis dev powershell asp.net_core Access to allow asp.net core write logs run the following script:


$logs = "C:\inetpub\wwwroot\logs"

New-Item -type directory -path $logs

$acl = Get-Acl $logs
$AccessRule = New-Object system.security.accesscontrol.filesystemaccessrule("IIS_IUSRS","Write","Allow")
$acl.SetAccessRule($AccessRule)
Set-Acl $logs $acl
otakuSiD
гавно AD dev powershell Import-Module ActiveDirectory timing out

social.technet.microsoft.com

Причем тихо валится, без единой ошибки.

И внезапно:

Beginning in Windows PowerShell 3.0, modules are imported automatically when any cmdlet or function in the module is used in a command. This feature works on any module in a directory that this included in the value of the PSModulePath environment variable.

technet.microsoft.com

Так что сбриваем нахрен импорт.