Reply To: Ok, convert this!
Poshoholic wrote: The method I shared yesterday is a little different than what you were doing, because I pulled out the individual pieces so that you could do something with them (like pass them in...
View ArticleReply To: Ok, convert this!
Yup, you got it, you don’t need to do manual parsing this way. The ParseExact static method does that work for you.
View ArticleReply To: Ok, convert this!
Poshoholic wrote: Yup, you got it, you don’t need to do manual parsing this way. The ParseExact static method does that work for you. Thanks Posholic, I appreciate your assistance.
View ArticleXml file line break
Hi, i’m trying to add a node and save the xml file. We have a standard xml template for our sql database restore ( which we use third party for sql backups and restore ). i will show the example how...
View ArticleReply To: Xml file line break
There should not be an issue, no. This isn’t PowerShell doing it, per se; it’s the underlying .NET Framework XML parser. XML isn’t sensitive to carriage returns; any carriage returns are just to help...
View ArticleIdentify Internet connected NIC
Does anyone know of a 2012 NIC property that is the equivalent of GUI ncpa.cpl Network Connections “Internet Access”? I’m trying to use that property in a PowerShell script to identify the NIC that I...
View ArticleReply To: Identify Internet connected NIC
Check the Get-NetConnectionProfile cmdlet in the NetConnection module. It will show data like this: Name : NetworkName InterfaceAlias : AdapterName InterfaceIndex : 12 NetworkCategory : Private...
View ArticleWrite-Progress Help
In my script I have a Try and Catch block. Inside my catch block I’m calling five functions. These functions take a minute or two to complete. I would love to show my end user a progress bar when...
View ArticleReply To: Identify Internet connected NIC
This is perfect! Thank you very much Richard!!! Here’s the final script: $PublicInterface = Get-NetConnectionProfile -IPv4Connectivity Internet | Select-Object -ExpandProperty InterfaceAlias...
View ArticleReply To: Write-Progress Help
Put a line like this just before each of your 5 steps, but use 99 for the percent at the last item: Write-Progress -Activity “Processing Catch Actions” -CurrentOperation “What I’m Doing Now”...
View ArticleRequired Parameter Name Missing – Works?
I ran the following command and I didn’t expect it to work because -LogName is positional (position 1) and I didn’t specify the parameter name (-LogName). The command did run successfully. (And I...
View ArticleLogging a PSSession
Hi all, TL;DR – is there a way to pull the definition for the script or script block that Invoke-Command runs, in the context of the remote session? I’m working on building a framework for delegated,...
View ArticleReply To: Logging a PSSession
I mostly use it with scheduled tasks and not invoked script blocks, but see if Start-Transcript might solve this for you. http://technet.microsoft.com/en-us/library/hh849687.aspx
View ArticleReply To: Logging a PSSession
I don’t believe this will work with Start-Transcript. To clarify, the logging needs to take place within the remote session. My issue is that within the remote session, I’m having trouble identifying...
View ArticleReply To: Hardcoding Domain Password in Script. Really???
The problems I had so far with ConvertTo-SecureString is that the string is encoded using the current users private key, and therefore not unencryptable for other users (makes sense from a security...
View ArticleReply To: Required Parameter Name Missing – Works?
As far as I know the first parameter you do not specify the parameter name for, will be considered the first positional parameter. The same can be observed in examples like: Get-ChildItem -Recurse...
View ArticleReply To: Help With Setting WinHttpRequest Options
The problem seems unfixable; you might want to explore http://social.technet.microsoft.com/Forums/scriptcenter/en-US/0669b8e2-cd0c-4122-9311-fda174e81709/powershell-with-winhttpwinhttprequest51 and...
View ArticleReply To: Required Parameter Name Missing – Works?
Whenever I run into one of these “WTF?!?” moments, I haul out Trace-Command. It can show me what’s being bound where, and how. Would a tutorial be helpful? If so, I’ll write one up for an upcoming...
View ArticleReply To: Logging a PSSession
You can’t easily access that from the remote session. Keep in mind that the remote computer isn’t running familiar old PowerShell.exe; it’s running wsmprovhost.exe, which doesn’t offer all the same...
View Article