$ cat Dockerfile
FROM ubuntu:latest
ENTRYPOINT ls $MYVAR
$ docker run --env MYVAR='-l' ubuntu/test /bin/sh
docker run -d -p 80:80 webserver-image:v1
запускается контейнер? netstat -tulpn
Invoke-WmiMethod -Class Win32_Process -ComputerName localhost -Name Create -ArgumentList "C:\Windows\System32\msg.exe * Alarm."
$targetDir = "C:\Path"
$destinationDir = "\\hostname\path"
if (!(Test-Path $targetDir))
{
Write-Warning "Target path does not exist."
Exit(1)
}
if (!(Test-Path $destinationDir))
{
Write-Warning "Destination path does not exist."
Exit(1)
}
$notification = New-Object -ComObject Wscript.Shell
$lastCreationFile = Get-ChildItem $targetDir -File |
Where-Object { $_.Name -like "*.ps1" } |
Sort-Object -Property CreationTime |
Select-Object -Last 1
$oldFile = Get-ChildItem $destinationDir -File
$oldFile.FullName | Remove-Item -Force
$retVal = $?
if ($retVal)
{
Copy-Item -Path $lastCreationFile.FullName -Destination $destinationDir
$notification.Popup("File $lastCreationFile.Name has been copy.")
}
else
{
$notification.Popup("File $oldFile.Name was not removed.")
}
Function Get-NProcesses
{
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[switch]$Multiple,
[switch]$LastProcess
)
PROCESS
{
$listProcesses = Get-Process| Select-Object -Unique | Select-Object -Property ProcessName, StartTime
if($Multiple)
{
foreach($process in $listProcesses.ProcessName)
{
if((Get-Process $process).Count -gt 1)
{
$process
}
}
}
if($LastProcess)
{
$listProcesses | Where-Object { $_.StartTime -ne $null } | Sort-Object -Property StartTime | Select-Object -Last 1
}
}
}
Хотя в принципе если еще несколько раз попробовать, все нормально работает. Спасибо.
/etc/sudoers
редактировать тоже не стоит. Нужно использоватьvisudo
. ;)