What is the path to a user's home directory from root?
I have a PowerShell script that uploads a pfx file using psftp.exe from PuTTY. When I first sftp'd to the BIG-IP I created a folder named "cert", and the path is /home/USERNAME/cert. I upload the pfx file. My problem is I have another PowerShell script that imports the pfx file. Here's my code:
if ( (Get-PSSnapin | Where-Object { $_.Name -eq "iControlSnapIn"}) -eq $null ){ Add-PSSnapIn iControlSnapIn }
$bigip_name = 'QA' $user = 'USERNAME' $pass = 'Password'
$bigip = New-Object -TypeName iControl.Interfaces; $success = $bigip.initialize($bigip_name, $user, $pass);
$bigip.ManagementPartition.Set_active_partition("Common");
$mgmtmode = New-Object -TypeName iControl.ManagementKeyCertificateManagementModeType $mgmtmode.value__ = 0
$SSLDir = "E:\PowerShell\SSL\IssuedCerts\PFXs"
$url = "test.hanktest22.com"
$pfxfilename = $url + ".pfx" $pfxfile = "/home/USERNAME/cert/" + $pfxfilename
$exportPass = "exportPass" Set-Location -Path $SSLDir $bigip.ManagementPartition.Set_active_partition("Common")
$bigip.ManagementKeyCertificate.pkcs12_import_from_file( ($mgmtmode), ($url), ($pfxfile), ($exportPass), ($true) )
This worked the other day, however it isn't working today. I believe I can't see that folder and perhaps the home folder is an alias for a longer path.
Thanks in advance for the help!
Hank