← All posts tagged powershell
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
Recommend
Recommend
Recommend
гавно 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
Так что сбриваем нахрен импорт.
Recommend
Recommend
Recommend
Recommend
dev powershell
location of the current PowerShell script:
stackoverflow.com
#PowerShell 3+
# This is an automatic variable set to the current file's/module's directory
$PSScriptRoot
Recommend
Recommend
dev powershell
download files
blog.jourdant.me
$webclient = new-object System.Net.WebClient
$webclient.Credentials = new-object System.Net.NetworkCredential("login", "pass")
$webclient.DownloadFile($artifacts_url, $artifacts_archive)
Recommend
Recommend