15,177 questions with no answers
0
votes
0
answers
30
views
I am running Ollama (a local LLM service) on Windows and need to programmatically detect which port it's currently listening on
What I've tried:
Using Get-NetTCPConnection but it returns too much information and I can't reliably filter for Ollama:
Get-NetTCPConnection -State Listen | Where-Object {$_.LocalPort -gt 11400}
...
4
votes
0
answers
55
views
How to effectively search $home in PowerShell if you are looking for hidden directories?
I am writing a Powershell script which has a function:
$CutFiles3 = @(Get-ChildItem $home -Force -Directory -Filter autoruntemp*)
This command is slowing down my script and is taking 10 seconds to ...
2
votes
0
answers
97
views
Using MethodRental's SwapMethodBody on powershell classes
I recently discovered MethodRental and it seems really interesting, coming from JS, being able to pre-empt existing functions can be a neat hacky get-out-of-jail card for the toolbelt.
As an aside, ...
2
votes
0
answers
728
views
Using DeviceIOControl to get SMART-Info from USB-connected HDD
I want to read the SMART-attributes of an USB-attached HDD via Powershell.
Calling DeviceIOControl works fine if the HDD is build-in, but I dont understand the correct logics for getting the same info ...
0
votes
0
answers
102
views
Powershell's Az-GetStorageBlob cmdlet returning inconsistent results on different environments when blob does not exist
I have 2 different Windows VMs, both with the same version of the Az module (15.1). I am executing the exact same script on both.
At a point in the script where the Get-AzStorageBlob cmdlet is called, ...
1
vote
0
answers
99
views
How to run a powershell script as a domain Administrator in Vagrant
I have a Windows Domain with 2019 provisioned with Packer and Vagrant. It works fine, I have managed to create a SQL Server and join the domain.
When I try to provision an Exchange Server I need to ...
0
votes
0
answers
45
views
Export and Import SharePoint site using Get-PnPSiteTemplate & Invoke-PnPSiteTemplate will not preserve the value of the people/group field
I have a SharePoint source site which contain a People/Group field linked to a SharePoint group named "Level2", as follow:-
now i export the site using this powershell:-
Get-PnPSiteTemplate ...
0
votes
0
answers
127
views
Local unit testing apache airflow
Cannot Run Apache Airflow Unit Tests: sqlalchemy.exc.OperationalError: unable to open database file
I am attempting to run a single unit test within the Apache Airflow repository (airflow-core/tests/...
-1
votes
0
answers
79
views
An ad_group_membership resource(hashicorp/ad) get error The command line is too long
I have a code which map users to group via a resource ad_group_membership from terraform provider hashicorp/ad
locals {
# --- Загружаем все YAML-файлы ---
yaml_be = yamldecode(file(var....
1
vote
0
answers
118
views
Azure DevOps Pipeline YAML file - How To Access (upstream) Pipeline Resource Completion Time in downstream pipeline?
How to get the completion time of a stage in my upstream pipeline?
I read in the documentation that I can use resources.pipeline.<alias>.xyz, but I don't see any predefined variables that allow ...
2
votes
0
answers
109
views
How do I send arguments to application in windows launched with shell:appsFolder?
I know you can use the Get-AppxPackage and Get-AppxPackageManifest cmdlets in Powershell to get the package family and it's specific application entry point.
In this example with Windows Media Player ...
1
vote
0
answers
61
views
Delete DHCP-Reservation via Python Script
I want to delete DHCP Reservations using a Python script and have the following code:
import tkinter as tk
from tkinter import messagebox
import subprocess
def delete_reservation():
dhcp_server = ...
1
vote
0
answers
92
views
Invoke-WebRequest URL encoding
I want to retrieve content from web page. However, I tried above method but the error still come when the query string contain Chinese character.
code
$json = Get-Content -Encoding utf8 -Path "./...
0
votes
0
answers
139
views
error: Package is incompatible with 'all' frameworks in project when package does not already exist in C:\<USER>\.nuget\packages
I have a powershell script calling dotnet add
Script:
dotnet add `"$projectFilePath`" package "$packageName" --source "$dorsetIcsSourceName" --version "$...
2
votes
0
answers
122
views
#NAME? error when opening an Excel sheet via Powershell
I am trying to export Excel files to PDF. Since there are a lot of Excel files to be exported I'm trying to automate this via PowerShell. In principle this works fine, but some Excel files contain ...