Import Carbon Powershell Module from shared folder - powershell

I use Powershell Remoting version 2.0.
I have downloaded the Carbon Powershell Module. I copied it in shared folder:
\SharedServer\PowershellModules\Carbon-1.0.0
In my script ps1, I have this source code:
$PSPathCarbon = "\\SharedServer\PowershellModules\Carbon-1.0.0\Carbon"
. (Join-Path $PSPathCarbon Import-Carbon.ps1)
I get the following error:
The term
'\SharedServer\PowershellModules\Carbon-1.0.0\Carbon\Import-Carbon.ps1'
is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
Any suggestions about it?

Try:
. (Join-Path $PSPathCarbon 'Import-Carbon.ps1')
Or:
. "$PSPathCarbon\Import-Carbon.ps1"

Related

Set-Step is not recognised in Powershell script i am using

Set-Step : The term 'Set-Step' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
The above is the error i am facing while running PowerShell script to generate report from grabbing data from source.
Please help me to solve this issue .

PowerShell command to move to the root directory

Commands for changing the directory, using cd, are the same in PowerShell as in cmd.
However, the problem occurred when I wanted to move to the root directory.
If I'm on disk C, just write
cd C:\
However, in cmd it was possible to use a simpler command.
cd...
But, it is only possible in cmd. It does not work in PowerShell.
cd... : The term 'cd...' is not recognized as the name of a cmdlet, function, script file, or operable program. Check t
he spelling of the name, or if a path was included, verify that the path is correct and try again.
Is there any alternative to this command in PowerShell, please?
Thank you
Is this what your after?
PS C:\Windows\system32> cd\
PS C:\>
Or do you want to move from 'C:\Windows\system32>' to 'D:\' which would just be >D:

Powershell doesn't recognize openssl even after I added it to the system path

I am on a 64bit Windows 10. I installed Win64 OpenSSL v1.1.0f and added the install directory C:\OpenSSL-Win64\bin to my system PATH.
Upon running it in cmd or Powershell, I get:
openssl : The term 'openssl' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is
correct and try again.
What else am I missing?
If you're running it in Powershell, check $env:path to be sure "C:\OpenSSL-Win64\bin" is in there. Previous comments all reference the PATH variable in in cmd.exe, which your error message suggests you are not using.
If it is not, run the following command in Powershell:
$env:path = $env:path + ";C:\OpenSSL-Win64\bin"
May be you need to close the session and open a new powershell, whenever you make changes to env variable it does not work on current session.

Load Sqlanywhere data provider in powershell

In Powershell v5 I'm Trying to load the ianywhere provider dll. I'm getting this loader exception:
 : The term 'Â' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
Weird, right?
My load command is
Add-Type -path "C:\Temp\sa\iAnywhere.Data.SQLAnywhere.v4.0.dll"
The ianywhere dll requires accompanying native dlls, which I have placed in the same folder. Those come in two versions, 32bit and 64 bit. I've tried both, and I've tried 32bit powershell and 64bit powershell. My shell is running as admin as well.

PowerShell - Including .ps1 files - invoke from other folder

Im struggling with a PowerShell challenge, the setup is as follows:
In the C:\update folder I have ReInstall.ps1 powershell script, that will try to run a script in a folder on another drive:
q:\test\install.ps1
In the q:\test folder, I have a Powershell file callled Install.ps1 that tries to include another ps file called InstallFunctions.ps1
. .\installfunctions.ps1
The two Install ps files works nicely when executed from the q:\test\folder.
But if I try to run the ReInstall.ps1 script from the c:\Update folder, it nicely starts the q:\install.ps1, but then fails because it can't find the Installfunctions.ps1.
It tries to find the InstallFunctions.ps1 in the c:\update folder, instead of the q:\test folder.
The term '.\installfunctions.ps1' is not recognized as the name of a cmdlet, >function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path >is correct and try again.
Since the Install ps files are inside a ISO file, and must work in any scenario, I can't change them. So I have to figure out a way to make the Install.ps1 believe it runs from q:\test folder.
You have to retrieve the script folder like this (PS 2.0):
$scriptPath = Split-Path $MyInvocation.MyCommand.Definition
. "$scriptPath\installfunctions.ps1"
#or . (Join-Path $scriptPath "installfunctions.ps1")
In PS 3.0 $PSScriptRoot holds the info you need:
. "$PSScriptRoot\installfunctions.ps1"
#or . (Join-Path $PSScriptRoot "installfunctions.ps1")