MSI install powershell program but no modules available - powershell

I installed AutomatedLab.msi from here - https://github.com/AutomatedLab/AutomatedLab/releases
it installed without any errors but there doesn't appear to be any powershell modules available... or it doesn't seem to know where the modules are? Is there anything else that I can do...
PS C:\Users\Administrator\Downloads> Get-LabAvailableOperatingSystem -Path C:\LabSources
Get-LabAvailableOperatingSystem : The term 'Get-LabAvailableOperatingSystem' 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.
At line:1 char:1
+ Get-LabAvailableOperatingSystem -Path C:\LabSources
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-LabAvailableOperatingSystem:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Is there some special way I'm supposed to install msi executables? Ive tried 'start-process' I've tried "Install-Module MSI" I can't seem to get anything to work.
Any suggestions?

Related

Activate a virtual environment in Windows Powershell with a command that is equivalent to "source"

I need to activate a virtual environment in Windows Powershell. But, the guide i am using that to proceed my project tells me to use a command like this:
source venv-slither/bin/activate
In my project directory, in first, i installed virtualenv with:
pip3 install virtualenv
After that, I setup a virtual environment in folder ./venv-slither with:
source venv-slither/bin/activate
Problem emerges here. Whenever i run the last command i approaches to this message in Powershell:
source : The term 'source' 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.
At line:1 char:2
+ source venv-slither/bin/activate
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (source:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I read some guide to eliminate this. They suggest using . instead source, but by this way the same error occurs. When, my Command is:
. venv-slither/bin/activate
The message is:
. : The term 'venv-slither/bin/activate' 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.
At line:1 char:3
+ . venv-slither/bin/activate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (venv-slither/bin/activate:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
More over, when i change slashes direct:
. venv-slither\bin\activate
This message comes up:
. : The module 'venv-slither' could not be loaded. For more information, run 'Import-Module venv-slither'.
At line:1 char:3
+ . venv-slither\bin\activate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (venv-slither\bin\activate:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CouldNotAutoLoadModule
I have these modules in my project directory: .bin, dot, findit, source.
Please help a beginner man in working with Windows Powershell.
I think you should use like this, within Windows PS:
venv-slither/Scripts/activate.ps1
After enabling the necessary execution policy for the current user with this command:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
I would return to previous policy with this command, after you finish your work, for safety:
Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope CurrentUser
There are other ways to set the execution temporarily. For example, I can set for the current PS's session by issuing this command:
powershell.exe -ExecutionPolicy RemoteSigned
* RemoteSigned or Unrestricted, you can refer to this link to view the details which scripts are or not allowed for each type of policy:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.1
Sorry for posting too late, I've just run into your post when found the same issue, tested myself and it worked.

Powershell `Set-MpPreference` not recognized

On running Set-MpPreference -DisableScriptScanning 1, I'm getting:
The term 'Set-MpPreference' 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.
At line:1 char:1
+ Set-MpPreference -DisableScriptScanning 1
~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-MpPreference:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I've gone through the following threads, but nothing seems to work:
Add-MpPreference is not recognized as a name
Powershell Set-MpPreference -DisableRealtimeMonitoring $true not working
I'm using Powershell v5.1 on Windows 7.
What could the reason be?
Have you tried
Import-Module Defender
I am not sure if the module exists on Windows 7 yet tough...
Use 64bit Powershell:
C:\windows\sysnative\WindowsPowershell\v1.0\powershell.exe

How do I add exclusions to Microsoft Security Essentials (MSE, Windows 7) through a powershell script?

I need to be able to add antivirus exclusions to MSE on Windows 7 using a powershell (or cmd) script. If I use:
Add-MpPreference -ExclusionPath "C:\Temp"
Add-MpPreference -ExclusionPath "C:\Users\ME\Desktop"
in powershell (which works for Windows 10 Windows Defender) I get this error:
The term 'Add-MpPreference' 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.
At line:1 char:17
+ Add-MpPreference <<<< -ExclusionPath "C:\Temp"
+ CategoryInfo : ObjectNotFound: (Add-MpPreference:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Any ideas?

Import-Module stops working sporadically

I have a problem where Import-Module -Name "./MyAssembly.dll" stops working sporadically. If I restart the computer, everything seems to work as normal for a while, but it's getting really frustrating.
The reason for importing the same module (in different Powershell sessions) is because I'm currently writing a cmdlet using C#, and I start a powershell instance as part of debugging the cmdlet.
The Import-Module command gives me no feedback whatsoever of whether or not the loading succeeded.
PS C:\Source\MyProject> Import-Module -Name "./MyAssembly.dll"
PS C:\Source\MyProject> Get-Stuffz
Get-Stuffz : The term 'Get-Stuffz' is not recognized as the name of a cmdlet, function, script file, or ope
rable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
.
At line:1 char:1
+ Get-Stuffz
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-Stuffz:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Any help or suggestions are welcome.

Pipe more doesn't seem to be working in Powershell v4.0

I'm trying to run a command that displays several screens of text and I'm trying to use the more command, but it doesn't seem to be working.
When I try to use a command like this:
Get-Help Get-Alias -full | more
I get an error that says this:
more.com : The term 'more.com' 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.
At line:14 char:14
+ $input | more.com
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (more.com:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Anyone have any ideas as to why?
Turns out that powershell.exe was not in the path.