|
To be clear, I'm most annoyed at this API that randomly decides to put the most critical returned ID value in the header rather than the JSON. Thanks for the tips all.
|
![]() |
|
![]()
|
# ? May 28, 2024 08:48 |
|
Sounds like it should put it in both
|
![]() |
|
stupid newbie question: I have a summarization process I run on a monthly basis that combines data from a poo poo load of disparate spreadsheets (67 of them to be exact). Part of this summarization process relies on Excel's INDIRECT() function in the main workbook building strings of filepaths based on other criteria yadda yadda. What this means is that for my summarization to work, I have to physically open every single workbook I want to pull data from. I hate doing this manually and would rather just have something do this for me while I walk away for a minute. I wrote a script to open all the proper workbooks containing the string that I need, and that part works just fine. The problem I'm running into is having 68 spreadsheets open all at once crashes my system. I'd like to add a pause about halfway through. How do I do that? I found a way to pause in between, but the way variable increments work in powershell is apparently not what I would have thought and the pause fires off in between EVERY workbook instead of at the increment I wanted. For example: code:
|
![]() |
|
Pay no attention to the man behind the curtain
|
![]() |
|
Powershell comparisons use argument flags. Your comparison should be code:
|
![]() |
|
[edit] I'm dumb
|
![]() |
|
Is the problem all 68 workbooks opening at the same time, or having all 68 workbooks open at the same time? If it's just that launching them all at once causes your system to freak out, I'd add start-sleep -seconds 5 after every invoke item. This will cause your script to wait 5 seconds between calls of invoke-item. Also, powershell is way better at iterating than the way you're doing it. This doesn't really change how your script runs but it's much better powershell: code:
FISHMANPET fucked around with this message at 19:18 on Aug 24, 2018 |
![]() |
|
code:
|
![]() |
|
see, I told you it was something stupid. thanks yallFISHMANPET posted:Is the problem all 68 workbooks opening at the same time, or having all 68 workbooks open at the same time? If it's just that launching them all at once causes your system to freak out, I'd add start-sleep -seconds 5 after every invoke item. This will cause your script to wait 5 seconds between calls of invoke-item. yeah i tried using that method first and then figured i'd go the old for loop route to see if it worked any differently, when the problem was just the comparison I was using instead. definitely going back to the foreach method thanks again everyone e: after iterating a few times I could not get if(($array.IndexOf($item)%20) -eq 0) part to work for some reason, that just refused to trigger. instead i used a foreach loop and just incremented a variable anyway and used that instead. ended up with code:
thanks again goons kumba fucked around with this message at 21:36 on Aug 24, 2018 |
![]() |
|
kumba posted:see, I told you it was something stupid. thanks yall Out of curiosity, what's your full workflow here? Open 20 workbooks > Run processing against those 20 workbooks while they're open > Repeat?
|
![]() |
He has one "master" workbook that references data in the other workbooks via the INDIRECT function, and to let those formulas recalculate with newest data, he has to open those workbooks too.
|
|
![]() |
|
nielsm posted:He has one "master" workbook that references data in the other workbooks via the INDIRECT function, and to let those formulas recalculate with newest data, he has to open those workbooks too. What's the purpose of leaving them open then?
|
![]() |
PBS posted:What's the purpose of leaving them open then? I'm guessing you need to click the "recalculate" button in Excel to actually make it do the update.
|
|
![]() |
|
PBS posted:What's the purpose of leaving them open then? If you close the workbook, the formulas revert back to a #REF error because they're no longer open and accessible. Unfortunately, my process involves me copy + paste values over the formulas so the results stick. Hence, open 20 workbooks, pause while I copy + paste values, continue through the rest of them ![]() We're getting a permanent actual solution to this problem in a few months, this is just a stop gap that's part of a monthly reporting process until the time our infrastructure teams get everything in place e: for context, I'm a supervisor of an analytics team in a call center that does agent performance grades, and this is part of a monthly summarization of those graded calls
|
![]() |
|
kumba posted:If you close the workbook, the formulas revert back to a #REF error because they're no longer open and accessible. Unfortunately, my process involves me copy + paste values over the formulas so the results stick. Hence, open 20 workbooks, pause while I copy + paste values, continue through the rest of them Makes sense, you could also just automate excel too and then iterate over each workbook individually. https://blogs.technet.microsoft.com/heyscriptingguy/2006/09/08/how-can-i-use-windows-powershell-to-automate-microsoft-excel/ Glad to hear you're correcting the process, it's not a very modern workflow. (Even if you automate it)
|
![]() |
|
If the infrastructure team is full of lies and you need to expand on your current nightmare, check out the PSExcel module
|
![]() |
|
If any of you work with VSTS with your scripts, this page is changing my life today: https://blogs.msdn.microsoft.com/premier_developer/2016/04/13/tips-for-writing-powershell-scripts-to-use-in-build-and-release-tasks/ I had no idea you could do poo poo like this: code:
|
![]() |
|
Has anyone run into issues with VSCode not properly honoring PSBreakpoints while debugging Powershell? I'm used to ISE, in that I add a breakpoint & ISE always honors it, however in VSC I add a breakpoint on something even as simple as a comment and VSC just blows right past it sometimes. The heck?
|
![]() |
|
You can breakpoint comments?
|
![]() |
|
Wicaeed posted:Has anyone run into issues with VSCode not properly honoring PSBreakpoints while debugging Powershell? IIRC, VSCode breakpoints only trigger on executed code. As a result, you cannot place breakpoints on empty lines or in comments and expect them to trigger. Also, I have no idea how this compares to ISE, but if you put a breakpoint on a line in VSCode, it will trigger before the line is executed.
|
![]() |
|
Hi all. Looking for a little help configuring a classroom set of Lenovo Thinkpads running Windows 10. The computers make a system beep when certain three-key combinations are depressed simultaneously. This seems to be a common enough problem, as I've encountered a number of fixes online. From one link, website posted:Go to Device Manager and “Show Hidden Devices”. Under “Non-Plug and Play Drivers” you’ll see an item named “Beep”. Disable that and the “random beep” disappears. Once done, of course, you can hide the hidden devices again. Good enough, but from the same site: website posted:Windows 8 [and as it seems, Windows 10] no long exposes the “Non-Plug and Play Drivers” as part of the Device Manager, but there is another way to disable the “Beep ” driver/service. In fact, this likely works in Windows 7, Vista, and XP, but I can only confirm it’s use in Windows 8: I do not have admin rights on these machines. The teacher in the room has previously submitted a ticket on this issues and been rejected. A few questions: - Can I expect the above solution using sc.exe to persist for different users of the same machine? - I'm no PS expert, but does 'Set-Service -Name Beep -StartupType Disabled' look correct for disabling this beep? (but may require restart?) And would that persist for new users as well? - I'm no Windows networking expert, but can a one-liner be composed to hit all of these computers at once? To the effect of: code:
|
![]() |
|
How do you intend to authenticate as an administrator to Windows Remote Management on these machines? Additionally, do you know whether dns in your environment will actually let you resolve those machine names? Lastly, for asynchronous execution with retry/wait options, look at submitting these as powershell "jobs" Potato Salad fucked around with this message at 04:03 on Sep 12, 2018 |
![]() |
|
Potato Salad posted:How do you intend to authenticate as an administrator to Windows Remote Management on these machines? Oops. My hope is to hand off a one-liner to the network administrators so that it'll be an easier thing for them to decide to do. "System beeps happening sometimes" is a pretty vague ticket and sounds like it could be a rabbit hole. I'd like to gift-wrap it. Potato Salad posted:Additionally, do you know whether dns in your environment will actually let you resolve those machine names? No clue off hand. Is this easy to check without admin rights? If so I could have a look tomorrow. e: presumably something like 'ping computer1' would tell me what I need to know there? Potato Salad posted:Lastly, for asynchronous execution with retry/wait options, look at submitting these as powershell "jobs" Will look into it, thanks. Newf fucked around with this message at 04:47 on Sep 12, 2018 |
![]() |
|
Got it, that's much more clear. So...less Shadow IT ![]() Next time you're in, do the following to determine whether you're in a domain environment (you almost certainly are) Right mouse click on the Computer icon (in Windows 10, you'll reliably find This PC in a file browser's left column) Select Properties Look under the Computer name, domain In cmd, from another computer, run nslookup thefullnameofthefirstcomputer For example, nslookup rm304-dell8080.ad.happyschool.co.uk That'll tell you whether computers (1) are in a domain (2) have suitable DNS records Potato Salad fucked around with this message at 05:16 on Sep 12, 2018 |
![]() |
|
Potato Salad posted:Got it, that's much more clear. So...less Shadow IT Hey, thanks. Will check on this tomorrow and poke back here with updates. Further comments welcome ![]() Newf fucked around with this message at 05:37 on Sep 12, 2018 |
![]() |
Does anyone know of a PS module or method for reading/querying/updating SharePoint lists? The idea being to write tools in PS that fetch some data and store in a SharePoint list for a web-based lookup tool to use.
|
|
![]() |
|
server or o365
|
![]() |
SharePoint Server (2010 because upgrading is unnecessary busywork)
|
|
![]() |
|
Hi, friends. I'm looking for some help with Azure AD. I'm trying to mass-remove Yammer licenses from everyone in my environment, but I'm having a dickens of a time putting together a functional PowerShell script. Most guides I've found online refers to the MSOLService commands that have been replaced with AzureAD commands (I think?). A straight update of scripts doesn't seem to work for me, though. Here's what I've learned so far: I can get a single AzureAD account with Get-AzureADUser. I can get a list of that user's assigned licenses and plans. I can get a list of sub-SKUs for the Enterprise Pack license, so I know the SKUs for the products I want to disable (Yammer). I can assign a license (ENTERPRISEPACK) while disabling the desired sub-SKU for a single user. My Script posted:$User = Get-AzureADUser -SearchString <upn> What I can't figure out is a) how to generate a list of all users who have the ENTERPRISEPACK license enabled and b) how to apply the above Yammer removal to those licensed users only. Any help appreciated! ![]() my cat is norris fucked around with this message at 20:57 on Sep 12, 2018 |
![]() |
|
nielsm posted:Does anyone know of a PS module or method for reading/querying/updating SharePoint lists? The idea being to write tools in PS that fetch some data and store in a SharePoint list for a web-based lookup tool to use. Use the CSOM https://social.technet.microsoft.com/wiki/contents/articles/29518.csom-sharepoint-powershell-reference-and-example-codes.aspx
|
![]() |
|
my cat is norris posted:Hi, friends. I'm looking for some help with Azure AD. I'm trying to mass-remove Yammer licenses from everyone in my environment, but I'm having a dickens of a time putting together a functional PowerShell script. Most guides I've found online refers to the MSOLService commands that have been replaced with AzureAD commands (I think?). A straight update of scripts doesn't seem to work for me, though. This one-liner should get you a list of everyone with ENTERPRISEPACK. code:
code:
|
![]() |
|
The Fool posted:<code> Thank you!! This is exactly what my brain couldn't piece together today.
|
![]() |
|
nielsm posted:Does anyone know of a PS module or method for reading/querying/updating SharePoint lists? The idea being to write tools in PS that fetch some data and store in a SharePoint list for a web-based lookup tool to use. Take a look at SPReplicator.
|
![]() |
|
The Fool posted:This one-liner should get you a list of everyone with ENTERPRISEPACK. ![]()
|
![]() |
|
Potato Salad posted:
OK, so it seems that nslookup works from one computer to another: ![]() This is presumably good news with respect to a scripted solution that hits all of the computers? Potato Salad posted:Lastly, for asynchronous execution with retry/wait options, look at submitting these as powershell "jobs" Is the idea something along the lines of this? Apologies for the js, but I can't bang out any PS control flow quickly. JavaScript code:
start-job -FilePath noBeep.ps1 ? An attempt in PS: code:
Newf fucked around with this message at 04:38 on Sep 13, 2018 |
![]() |
The Fool posted:Use the CSOM slartibartfast posted:Take a look at SPReplicator. Thanks, these look great.
|
|
![]() |
|
Newf posted:OK, so it seems that nslookup works from one computer to another: No, you would want to manage the jobs within the script itself and not set it to run infinitely in the job, but instead within the job wrapper. You could write to a file to store state or just keep updating a variable, either way really. Here's a basic framework for a "threaded" powershell script. It can be further simplified and some of what's in there is just for what I needed, but it should give you an idea. PowerShell code:
|
![]() |
|
Does anyone have a fairly straightforward script to import an SSL cert and create a secure website with IIS? I need to deploy an oracle application that requires SSL.
|
![]() |
|
The Oracle application isn't using weblogic + Oracle security wallet?
|
![]() |
|
![]()
|
# ? May 28, 2024 08:48 |
|
Potato Salad posted:The Oracle application isn't using weblogic + Oracle security wallet? No, this is UPK, its just a standard install wizard and it asks you to pick a secure website from IIS (or disregard).
|
![]() |