Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql 无法在powershell中运行pg_basebackup_Postgresql_Powershell - Fatal编程技术网

Postgresql 无法在powershell中运行pg_basebackup

Postgresql 无法在powershell中运行pg_basebackup,postgresql,powershell,Postgresql,Powershell,我们正在尝试在Powershell中的Windows上运行pg_basebackup脚本。该命令似乎在windows命令行(cmd)中工作,但在某些机器上不在powershell中工作。我们正在以管理员身份运行Powershell。有人碰到过这个吗 以下是我们正在运行的命令: pg_basebackup --host "localhost" --port "5432" --username="test" --password="

我们正在尝试在Powershell中的Windows上运行
pg_basebackup
脚本。该命令似乎在windows命令行(
cmd
)中工作,但在某些机器上不在
powershell
中工作。我们正在以管理员身份运行Powershell。有人碰到过这个吗

以下是我们正在运行的命令:

pg_basebackup --host "localhost" --port "5432" --username="test" --password="testpassword" --progress --verbose -D "C:\test\master\base_backups\test"
试着用这个

# Put here your pg_basebackup file location
Set-Location "C:\PostgreSQL\9.6\bin" 
# Put Here your password
$env:PGPASSWORD = "testpassword" 
[string]$job = .\pg_basebackup --% -U test --progress --verbose -D "C:\test\master\base_backups\test"
结果将出现在
$job
变量中。

请描述“不工作”。另外,
--password
不接受参数。谢谢您回复:--password。我所说的“不工作”,是指powershell看起来好像在尝试做什么,但什么也不做,也不输出任何输出。