Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all 15028 articles
Browse latest View live

Running Remote File.bat with parameters - not working?

$
0
0

Greetings,

I've been trying for a couple of days to figure out how this work...

i've tried the following methods to run a specific bat file on a remote machine:

Invoke-Command -ComputerName <Name> -ScriptBlock {& 'Path\File.bat -Parameter'}

Invoke-Command -ComputerName <Name> -ScriptBlock {& 'Path\File.bat'} -ArgumentList '-Parameter'

Anyone has any idea?

Best Regards,

Slyfer.


Powershell script and renaming files

$
0
0

Hay folks, I'm new to here and powershell so forgive the noob and dumb questions....

I'll include my script below but in short, I have been producing media for many years, and in many formats.  I am now low on drive space so been converting it all to HEVC/x265 WAV/MP3 (hay for that matter, CD, MiniDisk and Tapes to MP3) etc but wish to update the file names.

1, I want to ask for user input (ie folder location) and for the script to include all files in the sub folders too.

2, I'd like to see a better output at the end, either to a text file (detailed list for example), output in screen (just x files found and x changes made).

3, The pause command needs enter - I was hope for any key so may be you have a better idea - and I thought you could change the message pause displays??  Could in my old days in DOS I'm sure!

4, as a separate issue, I in some cases need to alter the format of the title, moving the first "word" ie A  The  I  , and might need to be done in a separate routine.  A good example of this is think about music and mp3.  The Beatles - Sgt. Pepper's Lonely Hearts Club Band - I wish to move the first word "The" so as to read,      Beatles (The) - Sgt. Pepper's Lonely Hearts Club Band
This is a good example, as it is always a fixed preset such as "The" and would be entered in to brackets but it's how to define where to move first word too.  My formats generally match the following.

So an example is an advert project so its the folder I wish to change,      The Movie Man (2018)

Would become                                                                                            Movie Man (The) (2018)

Or example my backing music,  The cold wild world - Instrumental (2004) - DP a TW Studio 11-5-2004 - WAV

Will become                               Cold wild world (The) - Instrumental (2004) - DP a TW Studio 11-5-2004 - WAV

and with the other changes it would become (see below!)   Cold wild world (The) - Instrumental (2004) - DP a TW Studio 11-5-2004 - MP3 Re-Encoded 2019

This is what I came up with so far and thanks in advance!!

echo off
cls

Write-Output "


Hi. This edit's any files in a given folder renaming and removing information from all the files in the folder.


"

$drive = read-host "Input Source Files to edit"

CD "$drive"

get-childitem *.*| foreach { rename-item $_ $_.Name.Replace("WAV", "MP3 Re-Encoded 2019") }

cls

Write-Output "

Ok then, what ever matched my pre-defined list has now been changed.

Press Enter key to continue and close / end this operation.

"
pause


Script to change Default system UI language, System locale, Input language

$
0
0

Is there any script which can change Default system UI language, System locale, Input language.

condition is this should not be User specific, it should be machine specific

for eg: if the current device is in en-US language it should be changed to fr-FR.

Our main intention is to change the regional language according to client specific location.


JessyDG

Retriving Mozilla Firefox Browser History.

$
0
0

Hello,

I'm Creating a script which should retrieve History of the Mozilla Firefox Browser.

where on the hard disk "Mozilla Firefox" history is stored.

is there any other way we can achieve this task.

 

Powershell: Remote Invoke-Command with -ScriptBlock changes types of arguments if scripblock contains variables

$
0
0

What's going on here???

PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Write-Host hi} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name} 
ScriptBlock 
PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Write-Host hi} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name; $a=3} 
String 
PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Get-ChildItem} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name} 
ScriptBlock 
PS C:\> Invoke-Command -ComputerName somemachine -Credential $cred -ArgumentList {Get-ChildItem} -ScriptBlock {param($sb); Write-Host $sb.GetType().Name; $a=3} 
String

controlling record devices in Windows

$
0
0

I've played with the command line utility NIRCMD.EXE and found it very effective at manipulating level and mute controls that appear under the "playback devices" tab of the sound window of Windows 7.  BUT I need to find a way to manipulate the controls found under the "record devices" tab.  Can this be done with Power Shell, or is there some other command line utility that I've overlooked that will give me access to these particular handles?  I'm working with a virtual sound card driver that provides four inputs and four outputs for AES67 IP audio.  In Windows 7 the driver places the level and mute controls for the four inputs under the "record devices" tab where I am thus far unable to access them via command line.  Any suggestions would be appreciated.

Run Remove-MailboxExportRequest unattended

$
0
0

I made a powershell script to delete all completed export mailbox requests.
The script to be executed is: "Get-MailboxExportRequest -Status Completed | Remove-MailboxExportRequest"
The script is executed using a command file; it works fine, however it asks me to confirm the action manualy.

Is there a way to run it without confirming the action, so I can run it as a shedualed task?

Building A Script through WMI to Find Software

$
0
0

Hello,

My goal is to build a few scripts using Powershell, and unfortunately using WMI, to find all software that has been installed in the past two weeks, including the date installed, and then outputting that information to log file.

I know how to find software and the date it was installed using:

"Get-WmiObject -Class | Format-Table -Property Name,InstallDate"

I just don't know how to filter for any software installed in the last two weeks.

I also need to find all software that needs to be installed but has to yet, so any suggestions for either one of these would be killer.

Thanks all.


find where a service account is being used.

$
0
0

we need to change the password on an account used for services.

is there a script out there to find where and what servers its being used on throughout the domain.

thanks

Remediation for Microsoft Windows Unquoted Uninstall Path Enumeration Vulnerability

$
0
0

Afternoon All,

Currently pulling my hair out with this one, following from the Unquoted Service Path Enumeration Vulnerability fix we are needing to do the same for Uninstall path’s

I have found the following script but am struggling to get it work,

$BaseKeys = "HKLM:SystemCurrentControlSetServices", #Services"HKLM:SoftwareMicrosoftWindowsCurrentVersionUninstall", #32bit Uninstalls"HKLM:SoftwareWow6432NodeMicrosoftWindowsCurrentVersionUninstall" #64bit Uninstalls
#Blacklist for keys to ignore
$BlackList = $Null
#Create an ArrayList to store results in
$Values = New-Object System.Collections.ArrayList
#Discovers all registry keys under the base keys
$DiscKeys = Get-ChildItem -Recurse -Directory $BaseKeys -Exclude $BlackList -ErrorAction SilentlyContinue |Select-Object -ExpandProperty Name | %{($_.ToString().Split('') | Select-Object -Skip 1) -join ''}
#Open the local registry
$Registry = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 'Default')
ForEach ($RegKey in $DiscKeys)
{
#Open each key with write permissions
Try { $ParentKey = $Registry.OpenSubKey($RegKey, $True) }
Catch { Write-Debug "Unable to open $RegKey" }
#Test if registry key has values
If ($ParentKey.ValueCount -gt 0)
{
$MatchedValues = $ParentKey.GetValueNames() | ?{ $_ -eq "ImagePath" -or $_ -eq "UninstallString" }
ForEach ($Match in $MatchedValues)
{
#RegEx that matches values containing .exe with a space in the exe path and no double quote encapsulation
$ValueRegEx = '(^(?!u0022).*s.*.[Ee][Xx][Ee](?< !u0022))(.*$)' $Value = $ParentKey.GetValue($Match)
#Test if value matches RegEx
If ($Value -match $ValueRegEx) { $RegType = $ParentKey.GetValueKind($Match)
#Uses the matches from the RegEx to build a new entry encapsulating the exe path with double quotes
$Correction = "$([char]34)$($Matches[1])$([char]34)$($Matches[2])"
#Attempt to correct the entry
Try { $ParentKey.SetValue("$Match", "$Correction", [Microsoft.Win32.RegistryValueKind]::$RegType) } Catch { Write-Debug "Unable to write to $ParentKey" }
#Add a hashtable containing details of corrected key to ArrayList
$Values.Add((New-Object PSObject -Property @{ "Name" = $Match "Type" = $RegType "Value" = $Value "Correction" = $Correction "ParentKey" = "HKEY_LOCAL_MACHINE$RegKey" })) | Out-Null } } } $ParentKey.Close() }

$Registry.Close() $Values | Select-Object ParentKey,Value,Correction,Name,Type

when I run it as a whole I get these errors

At line:24 char:64+ ... gEx = '(^(?!u0022).*s.*.[Ee][Xx][Ee](?< !u0022))(.*$)' $Value = $Pare ...+                                                            ~~~~~~
Unexpected token '$Value' in expression or statement.
At line:32 char:63+ ... .Add((New-Object PSObject -Property @{ "Name" = $Match "Type" = $RegT ...+                                                            ~~~~~~
Unexpected token '"Type"' in expression or statement.
At line:32 char:62+ $Values.Add((New-Object PSObject -Property @{ "Name" = $Match "Type"  ...+                                                              ~
The hash literal was incomplete.
At line:32 char:166+ ... tion" = $Correction "ParentKey" = "HKEY_LOCAL_MACHINE$RegKey" })) | O ...+                                                                  ~
Missing closing ')' in expression.
At line:32 char:166+ ... tion" = $Correction "ParentKey" = "HKEY_LOCAL_MACHINE$RegKey" })) | O ...+                                                                  ~
Missing ')' in method call.
At line:22 char:1+ {+ ~
Missing closing '}' in statement block or type definition.
At line:19 char:1+ {+ ~
Missing closing '}' in statement block or type definition.
At line:13 char:1+ {+ ~
Missing closing '}' in statement block or type definition.
At line:32 char:168+ ... n" = $Correction "ParentKey" = "HKEY_LOCAL_MACHINE$RegKey" })) | Out- ...+                                                                 ~
Unexpected token ')' in expression or statement.
At line:32 char:169+ ... " = $Correction "ParentKey" = "HKEY_LOCAL_MACHINE$RegKey" })) | Out-N ...+                                                                 ~
Unexpected token ')' in expression or statement.
Not all parse errors were reported.  Correct the reported errors and try again.+ CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException+ FullyQualifiedErrorId : UnexpectedToken

However when trying to break it down running the different lines powershell is just crashing out when running line 9

Any idea’s?


Feb 18, 2009 article by ScriptingGuy1 -- How Can I tell which tables and columns are in a database without opening it?

$
0
0

Hello Sir/Madam,

Although the above article is now 10 years old -- I have learned a lot from it and used it quite a bit just to get useful info about my collection of MS-ACCESS databases.  It is truly a very useful script.  However, I am truly lost as to how the NEWLINE function can print the various (FIELD/FIELD TYPE) pairs for each table being queried for its DB schema info.  Obviously I am missing on some fundamentals of pipeline processing or the way the Get-DatabaseSchema function -- which is the heart of this script -- works. There are two main areas that I have spent many hours trying to understand but fail to:

(1) There is a sentence that says "We then send the table name back to the $Tables variable." followed by a box of 4 lines of code.  I struggled with understanding what this meant "send the table name back".

(2) That section of code that loops through the Columns of each specific table completely eludes me:

<pre>

$schemaColumn | foreach-object { if ($_.Table_Name -EQ $Table) {

                          {"$($_.COLUMN_Name ) $(Get-DataType ($_.DATA_TYPE))") }

                          }  # -- end for each object

                       }  # -- end for each table.

</pre>

It is in the second line where I thought a call to the New-Line function would exist, but there isn't any.  Yet the script works perfectly fine!  I would be highly grateful for a clarification as to the fundamental principles of PS operation -- and perhaps, also the way datasets[] work -- that I know I am lacking and that's why I cannot understand the code. 

Your advice/guidance would be highly appreciated.  Thanking you in advance.


R.Tan

Script question

$
0
0

Hello

I have a simple script to monitor a serverlog and with this script,  the pc speaks the complete useragent string.

I want it  to filter  out just the name after "compatible"  and speak only that word,

Is that possible?

Thank you

Get-Content useragent.log -Tail 1 -wait | % {if ($_ -match "Compatible")
{Add-Type -AssemblyName System.speech
$Location = "$env:useragent.log"
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$Contents = Get-Content $Location -Tail 1 | where {$_ -match "Compatible"}
$speak.Speak($Contents)}}

rundll32 printui.dll,PrintUIEntry doesn't seem to restore all settings

$
0
0

Hi all,

I am trying to export/import printer configuration from one device to another using "rundll32 printui.dll,PrintUIEntry". I have read all guides including the official MSFT:

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/rundll32-printui

However i see different results almost all the time.

The command i use should export all settings - /Ss with no additional arguments. I am looking at the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers" registry and i can see my printer. When i import the .dat file i see the settings changing in there, but when i open printer preferences the settings are the old one. 

I hope someone can advise.

Powershell get AD-Computer and DNS in one script

$
0
0

Hello,

I've been learning powershell and would like some help. I've been following this link Get-ADComputer .

I would also like to take each hostname and query the DNS and add that record to each line.

Something like this example Resolve-DNSName

It's not feasible to rely on IP address inside Object Attributes as it is almost always blank

I need to query the actual dns server.

Thanks

Azure Analysis Services - Pausing

$
0
0

Hello,

I am trying to Schedule my Azure SSAS server for it to just run on weekdays between 8 and 6 and i want to pause it for the rest of the time. 

Here is the script that i am using - 

param(

[string]
$environmentName = "AzureCloud",

[string]
$resourceGroupName = "PowerProd",

[string]
$serverName ="poweranalysis",

[string]
$azureProfilePath = "",

[string]
$azureRunAsConnectionName = "AzureRunAsConnection",

[string]
$configStr =
"

[

{

     WeekDays:[1,2,3,4,5]    

     ,StartTime: 
""08:00:00""

     ,StopTime: 
""17:59:59""

     ,Sku: 
""S4""

    } 

]

"

)

filter timestamp 
{"[$(Get-Date -Format G)]:
$_"}


Write-Output "Script started." 
| timestamp

$VerbosePreference 
= "Continue"

$ErrorActionPreference 
= "Stop"

#Authenticate with Azure Automation Run As account (service principal)

$runAsConnectionProfile 
= Get-AutomationConnection -Name 
$azureRunAsConnectionName

$environment 
= Get-AzureRmEnvironment -Name 
$environmentName

Add-AzureRmAccount -Environment 
$environment -ServicePrincipal `

-TenantId $runAsConnectionProfile.TenantId `

-ApplicationId 
$runAsConnectionProfile.ApplicationId `

-CertificateThumbprint ` 
$runAsConnectionProfile.CertificateThumbprint
| Out-Null

Write-Output "Authenticated with Automation Run As Account."
| timestamp


#Get current date/time and convert to $scalingScheduleTimeZone

$stateConfig 
= $scalingSchedule 
| ConvertFrom-Json

$startTime = Get-Date

Write-Output "Azure Automation local time: 
$startTime."
| timestamp

$toTimeZone =
[System.TimeZoneInfo]::FindSystemTimeZoneById($scalingScheduleTimeZone)

Write-Output "Time zone to convert to: 
$toTimeZone."
| timestamp

$newTime =
[System.TimeZoneInfo]::ConvertTime($startTime,
$toTimeZone)

Write-Output "Converted time: $newTime."
| timestamp

$startTime =
$newTime


#Get current day of week based on converted start time

$currentDayOfWeek 
= [Int]($startTime).DayOfWeek

Write-Output "Current day of week: $currentDayOfWeek."
| timestamp


# Get the scaling schedule for the current day of week

$dayObjects =
$stateConfig | Where-Object
{$_.WeekDays
-contains $currentDayOfWeek
} `

|Select-Object Sku, `

@{Name="StartTime"; Expression
= {[datetime]::ParseExact(($startTime.ToString("yyyy:MM:dd")+”:”+$_.StartTime),"yyyy:MM:dd:HH:mm:ss",
[System.Globalization.CultureInfo]::InvariantCulture)}}, `

@{Name="StopTime"; Expression
= {[datetime]::ParseExact(($startTime.ToString("yyyy:MM:dd")+”:”+$_.StopTime),"yyyy:MM:dd:HH:mm:ss",
[System.Globalization.CultureInfo]::InvariantCulture)}}


# Get the server object

$asSrv = Get-AzureRmAnalysisServicesServer
-ResourceGroupName 
$resourceGroupName -Name 
$serverName

Write-Output "AAS server name: $($asSrv.Name)"
| timestamp

Write-Output "Current server status: 
$($asSrv.State), sku:
$($asSrv.Sku.Name)"
| timestamp


if($dayObjects
-ne $null)
{ # Scaling schedule found for this day

# Get the scaling schedule for the current time. If there is more than one available, pick the first

$matchingObject 
= $dayObjects 
| Where-Object { 
($startTime 
-ge $_.StartTime)
-and ($startTime
-lt $_.StopTime)
} | Select-Object
-First 1

if($matchingObject
-ne $null)

{

Write-Output "Scaling schedule found. Check if server is paused and if current sku is matching..."
| timestamp

if($asSrv.State
-eq "Paused")

{

Write-Output "Server was paused. Resuming!"
| timestamp

$asSrv | Resume-AzureRmAnalysisServicesServer

Write-Output "Server resumed." 
| timestamp

}

if($asSrv.Sku.Name
-ne $matchingObject.Sku)

{

Write-Output "Server is not in the sku of the scaling schedule. Changing!"
| timestamp

$asSrv = Set-AzureRmAnalysisServicesServer
-Name $asSrv.Name
-ResourceGroupName 
$resourceGroupName -Sku 
$matchingObject.Sku

Write-Output "Change to edition/tier as specified in scaling schedule initiated..."
| timestamp

$asSrv = Get-AzureRmAnalysisServicesServer
-ResourceGroupName 
$resourceGroupName -Name 
$serverName

Write-Output "Current server state: 
$($asSrv.State), sku:
$($asSrv.Sku.Name)"
| timestamp

}

else

{

Write-Output "Current server sku matches the scaling schedule already. Exiting..."
| timestamp

}

}

else {
# Scaling schedule not found for current time

Write-Output "No matching scaling schedule time slot for this time found. Check if the server is paused..."
| timestamp

if($asSrv.State
-ne "Paused")

{

Write-Output "Server not paused. Pausing!"
| timestamp

$asSrv | Suspend-AzureRmAnalysisServicesServer

Write-Output "Server paused." 
| timestamp

$asSrv = Get-AzureRmAnalysisServicesServer
-ResourceGroupName 
$resourceGroupName -Name 
$serverName

Write-Output "Current server sate: $($asSrv.State), sku:
$($asSrv.Sku.Name)"
| timestamp

}

else

{

Write-Output "Server paused already. Exiting..."
| timestamp

}

}

}

else # Scaling schedule not found for this day

{

Write-Output "No matching scaling schedule for this day found. Check if the server is paused..."
| timestamp

if($asSrv.State
-ne "Paused")

{

Write-Output "Server not paused. Pausing!"
| timestamp

$asSrv | Suspend-AzureRmAnalysisServicesServer

Write-Output "Server paused." 
| timestamp

$asSrv = Get-AzureRmAnalysisServicesServer
-ResourceGroupName 
$resourceGroupName -Name 
$serverName

Write-Output "Current server state: 
$($asSrv.State), sku:
$($asSrv.Sku.Name)"
| timestamp

}

else

{

Write-Output "Server paused already. Exiting..."
| timestamp

}

} 


Write-Output "Script finished."
| timestamp

But i keep getting an error saying - 

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot bind argument to parameter 'InputObject' because it is null.

Can you please help me and let me know how i can get around this.

Thank you very much..!  



Invoke-Command returning data from multiple sessions.

$
0
0

Hi folks,

   I have a simple script that needs to connect to multiple machines, execute a command and return a status.  The issue I am having is matching the return results from each machine with its matching session (and machine name).

$s = NewPSSession -ComputerName $hostNames
$results = Invoke-Command -Session $s -ScriptBlock { param($p1) ... execute command... return $retVar } -ArgumentList $parm

$s
$results

# $s  will list the sessions (id, name, computername)
# $results  will list a value for each session, so for 4 machines I get something like:-
#  0
#  3
#  4
#  6

What I need to do is correlate the ComputerName property and the result value into a table

ComputerName   Value

   Bob                   0
   Fred                  3
   Dave                 4

The $results value just seems to be an array, however, I can find no documentation around the order of the values stored in it.  Are they in order of when the result was returned by invoke-command, or are they in order of  the sessions in $s  (so if 'Fred' is the second array element in $s, then 3 would be the second element in $results).

I need to execute the commands concurrently.   

My thought at the moment is to return a tuple [hostname,status] from invoke command.

Regards

Need help to fetch event viewer security Account Name,Logondate,Log off date,Source Network address,

$
0
0

I need powershell scripting help to fetch data just like above like username, logon date, networkip (request coming from).

could you please help me on this script.

thanks in advance.

VBRS

Handling Outlook-events in Powershell

$
0
0

I would like to write a script, that sends an E-Mail via our companys SMTP-Server using CDO.

First I tried to write an HTA-application for that purpose, but it became rather fiddly to make it cormfortable enough so that other people may handle it well (because of proper recipient resolving).

So now I try to use the regular Outlook-Mail mask to prepare the mail first and then catch the send-item event via Powershell to give it's content to a CDO script.

I'm rather new to powershell-scripting so I didn't come very far before running into the first problems... First of all I'm trying to catch the ItemSend-event. But whenever I run the following code and hit the send-button in my E-Mail, powershell simply crashes. What am I missing? I have never worked with events in powershell and all examples I can find are very very specific and sadly don't apply to my problem at all...

$WSH = new-Object -ComObject "WScript.Shell" $Outlook = new-Object -ComObject "Outlook.Application" $Action = { WSH.PopUp("TestEvent") } Register-ObjectEvent -InputObject $Outlook -EventName ItemSend -Action $Action $MailItem = $Outlook.CreateItem(0)

$MailItem.Display()

Scripting SQL backup and restore with Powershell

$
0
0

I have written a simple (currently messy work in progress) powershell script to loop through all databases on one SQL server, then restore them to a new one. It all seems to work fine, until I hit a bunch of databases from one system with curly brackets in the name. The backup is taken successfully, but the restore is failing with:

Restore-SqlDatabase : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

The section of code failing is:

$RelocateData = New-Object "Microsoft.SqlServer.Management.Smo.RelocateFile, $assemblySqlServerSmoExtendedFullName"($DatabaseName, $RelocateDatabasePath)

$RelocateLog = New-Object "Microsoft.SqlServer.Management.Smo.RelocateFile, $assemblySqlServerSmoExtendedFullName"($RelocateDatabaseLogName, $RelocateDatabaseLogPath)

$myarr=@($RelocateData,$RelocateLog)

Restore-SqlDatabase -ServerInstance $DestServerInstance -Database $DatabaseName -BackupFile $RestoreFilePath -RelocateFile $myarr -ReplaceDatabase 

The restore file path is: E:\DatabasesFromArchos\Gen_Pay_Sp_Master_2014_V2{057762B0-3B7A-4FFB-B4C2-7EA1B8E25AD5}.bak

Database name is: Gen_Pay_Sp_Master_2014_V2{057762B0-3B7A-4FFB-B4C2-7EA1B8E25AD5}

Database path is: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\Gen_Pay_Sp_Master_2014_V2{057762B0-3B7A-4FFB-B4C2-7EA1B8E25AD5}.mdf

Log name is: Gen_Pay_Sp_Master_2014_V2{057762B0-3B7A-4FFB-B4C2-7EA1B8E25AD5}_Log

Log path is: C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\Gen_Pay_Sp_Master_2014_V2{057762B0-3B7A-4FFB-B4C2-7EA1B8E25AD5}_Log.ldf

I have tried googling the error and understand the causes when inserting in to tables etc. but I can't find any reference to why this is happening on a restore, specifically with databases with curly brackets in the name.

Does anyone have any ideas what to try next?

Thanks,

Nick

How to handle public and private dependencies and packaging in Powershell binary module (.Net Standard & Nuget)

$
0
0

I would like to make a cli to go with a some buisness logic code I hope to also use with a gui using Xamarin.

I would just like some advice about best practice getting all of the required binaries in one place for powershell to access when I load my module.  I've had some success with a console app but I'd rather make a powershell module if possible as there are quite a few advantages on parsing arguments. 

The private dependencies (other project in solution) produce assemblies in the bin directory but public ones from nuget do not seem to and are missing unless I manually add them.  It isn't completely obvious which onces are missing and what version to copy over etc.

I have more specifics in a stackoverflow question but I haven't had a response over there yet and I thought this may be a better place to get some powershell binary module help as there isn't a powershell-binary-module tag over at Stackoverflow yet.

Thanks

Craig

https://stackoverflow.com/questions/51732417/how-can-i-publish-a-powershell-gallery-module-that-depends-on-a-platform-specifi?rq=1

Viewing all 15028 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>