https://github.com/startautomating/ollama-powershell
Ollama PowerShell: Play with AI in PowerShell
https://github.com/startautomating/ollama-powershell
Last synced: 6 months ago
JSON representation
Ollama PowerShell: Play with AI in PowerShell
- Host: GitHub
- URL: https://github.com/startautomating/ollama-powershell
- Owner: StartAutomating
- License: mit
- Created: 2025-03-02T02:27:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-03-22T00:15:41.000Z (10 months ago)
- Last Synced: 2025-07-08T20:51:53.276Z (7 months ago)
- Language: PowerShell
- Size: 37.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Play with AI in PowerShell
# Getting Started
## Installing ollama-powershell
You can install ollama-powershell from the [PowerShell Gallery](https://www.powershellgallery.com/packages/ollama-powershell/)
~~~PowerShell
Install-Module -Name ollama-powershell
~~~
To force an update, use the `-Force`
~~~PowerShell
Install-Module -Name ollama-powershell -Force
~~~
## Importing ollama-powershell
Once ollama-powershell is installed, you can import it by name:
~~~PowerShell
Import-Module -Name ollama-powershell -PassThru
~~~
Once it is loaded, you can get commands from ollama-powershell with Get-Command
~~~PowerShell
Get-Command -Module ollama-powershell
~~~
You can show the syntax of all commands with `Get-Command -Syntax`
~~~PowerShell
Get-Command -Module ollama-powershell -Syntax
~~~
You can get help about a command with `Get-Help`
~~~PowerShell
Get-Help Get-Ollama
~~~
You can show examples for a command with the -Examples
~~~PowerShell
Get-Help Get-Ollama -Examples
~~~
## Using ollama-powershell
There are a few ways to use ollama-powershell:
Without any parameters, or with unmapped input, `Get-Ollama` will run the `ollama` cli
~~~PowerShell
Get-Ollama
~~~
With PowerShell style parameters, `Get-Ollama` will wrap the [ollama api](https://github.com/ollama/ollama/blob/main/docs/api.md)
### Get-Ollama -Pull
Let's pull down a model:
~~~PowerShell
Get-Ollama -Pull -Model 'tinyllama'
~~~
### Get-Ollama -Chat
And now let's ask it something:
~~~PowerShell
Get-Ollama -Model 'tinyllama' -Chat 'Why is the sky blue?','Limit your response to three sentences or less.'
~~~
### Calling a model by name
If you have a model installed, you can refer to that model by name.
This is effectively a shortcut to `ollama run $ModelName`
~~~PowerShell
tinyllama "What are you?"
~~~
If you just downloaded a model and this does not work, re-import ollama-powershell with:
~~~PowerShell
Import-Module ollama-powershell -Force
~~~